2026-01-18 12:21:49 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div class="language-ecosystem-demo">
|
|
|
|
|
|
<div class="demo-header">
|
2026-02-13 22:10:03 +08:00
|
|
|
|
<span class="icon">🌐</span>
|
|
|
|
|
|
<span class="title">生态系统</span>
|
|
|
|
|
|
<span class="subtitle">不同语言的社区和包管理器</span>
|
2026-01-18 12:21:49 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-02-13 22:10:03 +08:00
|
|
|
|
<div class="intro-text">
|
|
|
|
|
|
想象你在<span class="highlight">逛超市</span>:有的超市商品种类多但质量参差(NPM),有的商品质量高但价格贵(Java Maven),有的商品精挑细选(Go Modules)。
|
2026-01-18 12:21:49 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-02-13 22:10:03 +08:00
|
|
|
|
<div class="ecosystem-grid">
|
|
|
|
|
|
<div
|
|
|
|
|
|
v-for="eco in ecosystems"
|
|
|
|
|
|
:key="eco.name"
|
|
|
|
|
|
class="eco-card"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div class="eco-icon">{{ eco.icon }}</div>
|
|
|
|
|
|
<div class="eco-name">{{ eco.name }}</div>
|
|
|
|
|
|
<div class="eco-lang">{{ eco.language }}</div>
|
|
|
|
|
|
<div class="eco-stats">
|
|
|
|
|
|
<div class="stat">
|
|
|
|
|
|
<span class="stat-label">包数量</span>
|
|
|
|
|
|
<span class="stat-value">{{ eco.packages }}</span>
|
2026-01-18 12:21:49 +08:00
|
|
|
|
</div>
|
2026-02-13 22:10:03 +08:00
|
|
|
|
<div class="stat">
|
|
|
|
|
|
<span class="stat-label">特点</span>
|
|
|
|
|
|
<span class="stat-value">{{ eco.feature }}</span>
|
2026-01-18 12:21:49 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2026-02-13 22:10:03 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="info-box">
|
|
|
|
|
|
<span class="icon">💡</span>
|
|
|
|
|
|
<strong>核心思想:</strong>JavaScript/Node.js 的 NPM 是世界最大的包仓库,几乎任何功能都有现成方案。Python 的 PyPI 在 AI 领域无敌。Go 的 Go Modules 简洁可靠,没有依赖地狱。
|
|
|
|
|
|
</div>
|
2026-01-18 12:21:49 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup>
|
2026-02-13 22:10:03 +08:00
|
|
|
|
const ecosystems = [
|
2026-01-18 12:21:49 +08:00
|
|
|
|
{
|
|
|
|
|
|
name: 'NPM',
|
|
|
|
|
|
icon: '💚',
|
|
|
|
|
|
language: 'Node.js',
|
2026-02-13 22:10:03 +08:00
|
|
|
|
packages: '200万+',
|
|
|
|
|
|
feature: '最大生态'
|
2026-01-18 12:21:49 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name: 'PyPI',
|
|
|
|
|
|
icon: '🐍',
|
|
|
|
|
|
language: 'Python',
|
2026-02-13 22:10:03 +08:00
|
|
|
|
packages: '50万+',
|
|
|
|
|
|
feature: 'AI 霸主'
|
2026-01-18 12:21:49 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name: 'Maven',
|
|
|
|
|
|
icon: '☕',
|
|
|
|
|
|
language: 'Java',
|
2026-02-13 22:10:03 +08:00
|
|
|
|
packages: '30万+',
|
|
|
|
|
|
feature: '企业级'
|
2026-01-18 12:21:49 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name: 'Go Modules',
|
|
|
|
|
|
icon: '🐹',
|
|
|
|
|
|
language: 'Go',
|
2026-02-13 22:10:03 +08:00
|
|
|
|
packages: '10万+',
|
|
|
|
|
|
feature: '简洁可靠'
|
2026-01-18 12:21:49 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name: 'Cargo',
|
|
|
|
|
|
icon: '🦀',
|
|
|
|
|
|
language: 'Rust',
|
2026-02-13 22:10:03 +08:00
|
|
|
|
packages: '10万+',
|
|
|
|
|
|
feature: '现代化'
|
2026-01-18 12:21:49 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name: 'RubyGems',
|
|
|
|
|
|
icon: '💎',
|
|
|
|
|
|
language: 'Ruby',
|
2026-02-13 22:10:03 +08:00
|
|
|
|
packages: '15万+',
|
|
|
|
|
|
feature: '优雅'
|
2026-01-18 12:21:49 +08:00
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
.language-ecosystem-demo {
|
|
|
|
|
|
border: 1px solid var(--vp-c-divider);
|
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
background: var(--vp-c-bg-soft);
|
2026-02-13 22:10:03 +08:00
|
|
|
|
padding: 1rem;
|
|
|
|
|
|
margin: 1rem 0;
|
|
|
|
|
|
max-height: 600px;
|
|
|
|
|
|
overflow-y: auto;
|
2026-01-18 12:21:49 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-13 22:10:03 +08:00
|
|
|
|
.demo-header {
|
2026-01-18 12:21:49 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
2026-02-13 22:10:03 +08:00
|
|
|
|
gap: 0.5rem;
|
|
|
|
|
|
margin-bottom: 0.75rem;
|
2026-01-18 12:21:49 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-13 22:10:03 +08:00
|
|
|
|
.demo-header .icon {
|
|
|
|
|
|
font-size: 1.25rem;
|
2026-01-18 12:21:49 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-13 22:10:03 +08:00
|
|
|
|
.demo-header .title {
|
|
|
|
|
|
font-weight: bold;
|
2026-01-18 12:21:49 +08:00
|
|
|
|
font-size: 1rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-13 22:10:03 +08:00
|
|
|
|
.demo-header .subtitle {
|
|
|
|
|
|
color: var(--vp-c-text-2);
|
2026-01-18 12:21:49 +08:00
|
|
|
|
font-size: 0.85rem;
|
2026-02-13 22:10:03 +08:00
|
|
|
|
margin-left: 0.5rem;
|
2026-01-18 12:21:49 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-13 22:10:03 +08:00
|
|
|
|
.intro-text {
|
|
|
|
|
|
font-size: 0.9rem;
|
2026-01-18 12:21:49 +08:00
|
|
|
|
color: var(--vp-c-text-2);
|
2026-02-13 22:10:03 +08:00
|
|
|
|
line-height: 1.6;
|
|
|
|
|
|
margin-bottom: 1rem;
|
|
|
|
|
|
padding: 0.75rem;
|
2026-01-18 12:21:49 +08:00
|
|
|
|
background: var(--vp-c-bg);
|
2026-02-13 22:10:03 +08:00
|
|
|
|
border-radius: 6px;
|
2026-01-18 12:21:49 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-13 22:10:03 +08:00
|
|
|
|
.intro-text .highlight {
|
|
|
|
|
|
color: var(--vp-c-brand-1);
|
|
|
|
|
|
font-weight: 500;
|
2026-01-18 12:21:49 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-13 22:10:03 +08:00
|
|
|
|
.ecosystem-grid {
|
2026-01-18 12:21:49 +08:00
|
|
|
|
display: grid;
|
2026-02-13 22:10:03 +08:00
|
|
|
|
grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
|
2026-01-18 12:21:49 +08:00
|
|
|
|
gap: 0.75rem;
|
2026-02-13 22:10:03 +08:00
|
|
|
|
margin-bottom: 1rem;
|
2026-01-18 12:21:49 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-13 22:10:03 +08:00
|
|
|
|
.eco-card {
|
|
|
|
|
|
background: var(--vp-c-bg);
|
|
|
|
|
|
padding: 0.75rem;
|
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
border: 1px solid var(--vp-c-divider);
|
2026-01-18 12:21:49 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-13 22:10:03 +08:00
|
|
|
|
.eco-icon {
|
|
|
|
|
|
font-size: 1.5rem;
|
|
|
|
|
|
margin-bottom: 0.25rem;
|
2026-01-18 12:21:49 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-13 22:10:03 +08:00
|
|
|
|
.eco-name {
|
2026-01-18 12:21:49 +08:00
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
font-size: 0.85rem;
|
|
|
|
|
|
color: var(--vp-c-text-1);
|
2026-02-13 22:10:03 +08:00
|
|
|
|
margin-bottom: 0.15rem;
|
2026-01-18 12:21:49 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-13 22:10:03 +08:00
|
|
|
|
.eco-lang {
|
|
|
|
|
|
font-size: 0.7rem;
|
|
|
|
|
|
color: var(--vp-c-brand-1);
|
|
|
|
|
|
margin-bottom: 0.5rem;
|
2026-01-18 12:21:49 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-13 22:10:03 +08:00
|
|
|
|
.eco-stats {
|
2026-01-18 12:21:49 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
gap: 0.25rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-13 22:10:03 +08:00
|
|
|
|
.stat {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
font-size: 0.7rem;
|
2026-01-18 12:21:49 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-13 22:10:03 +08:00
|
|
|
|
.stat-label {
|
2026-01-18 12:21:49 +08:00
|
|
|
|
color: var(--vp-c-text-2);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-13 22:10:03 +08:00
|
|
|
|
.stat-value {
|
|
|
|
|
|
color: var(--vp-c-text-1);
|
|
|
|
|
|
font-weight: 600;
|
2026-01-18 12:21:49 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-13 22:10:03 +08:00
|
|
|
|
.info-box {
|
|
|
|
|
|
background: var(--vp-c-bg-alt);
|
|
|
|
|
|
padding: 0.75rem;
|
|
|
|
|
|
border-radius: 6px;
|
2026-01-18 12:21:49 +08:00
|
|
|
|
font-size: 0.85rem;
|
|
|
|
|
|
color: var(--vp-c-text-2);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-13 22:10:03 +08:00
|
|
|
|
.info-box .icon {
|
|
|
|
|
|
margin-right: 0.25rem;
|
2026-01-18 12:21:49 +08:00
|
|
|
|
}
|
|
|
|
|
|
</style>
|