2026-01-16 19:10:21 +08:00
|
|
|
|
<!--
|
|
|
|
|
|
FrameworkComparisonDemo.vue
|
|
|
|
|
|
框架对比(更直观):选择关注点,表格高亮适配度。
|
|
|
|
|
|
-->
|
2026-01-15 20:10:19 +08:00
|
|
|
|
<template>
|
2026-01-16 19:10:21 +08:00
|
|
|
|
<div class="cmp">
|
|
|
|
|
|
<div class="header">
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<div class="title">主流框架对比(先看“适配度”)</div>
|
|
|
|
|
|
<div class="subtitle">先选你的关注点,再看推荐。</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="focus">
|
|
|
|
|
|
<button
|
|
|
|
|
|
v-for="f in focuses"
|
|
|
|
|
|
:key="f.id"
|
|
|
|
|
|
:class="['chip', { active: focus === f.id }]"
|
|
|
|
|
|
@click="focus = f.id"
|
|
|
|
|
|
>
|
|
|
|
|
|
{{ f.label }}
|
|
|
|
|
|
</button>
|
|
|
|
|
|
</div>
|
2026-01-15 20:10:19 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-01-16 19:10:21 +08:00
|
|
|
|
<div class="table">
|
|
|
|
|
|
<div class="row head">
|
|
|
|
|
|
<div>框架</div>
|
|
|
|
|
|
<div>上手</div>
|
|
|
|
|
|
<div>可控</div>
|
|
|
|
|
|
<div>多 Agent</div>
|
|
|
|
|
|
<div>适合做什么</div>
|
2026-01-15 20:10:19 +08:00
|
|
|
|
</div>
|
2026-01-18 12:21:49 +08:00
|
|
|
|
<div
|
|
|
|
|
|
v-for="fw in frameworks"
|
|
|
|
|
|
:key="fw.name"
|
|
|
|
|
|
:class="['row', { best: fw.name === best }]"
|
|
|
|
|
|
>
|
2026-01-16 19:10:21 +08:00
|
|
|
|
<div class="name">{{ fw.name }}</div>
|
|
|
|
|
|
<div>{{ fw.learn }}</div>
|
|
|
|
|
|
<div>{{ fw.control }}</div>
|
|
|
|
|
|
<div>{{ fw.multi }}</div>
|
|
|
|
|
|
<div class="use">{{ fw.use }}</div>
|
2026-01-15 20:10:19 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-01-16 19:10:21 +08:00
|
|
|
|
<div class="rec">
|
|
|
|
|
|
<div class="rec-title">此刻更推荐:{{ best }}</div>
|
|
|
|
|
|
<div class="rec-body">{{ reason }}</div>
|
2026-01-15 20:10:19 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup>
|
2026-01-16 19:10:21 +08:00
|
|
|
|
import { computed, ref } from 'vue'
|
|
|
|
|
|
|
|
|
|
|
|
const focuses = [
|
|
|
|
|
|
{ id: 'start', label: '快速上手' },
|
|
|
|
|
|
{ id: 'control', label: '可控可调试' },
|
|
|
|
|
|
{ id: 'team', label: '多 Agent 协作' }
|
|
|
|
|
|
]
|
2026-01-15 20:10:19 +08:00
|
|
|
|
|
2026-01-16 19:10:21 +08:00
|
|
|
|
const focus = ref('control')
|
2026-01-15 20:10:19 +08:00
|
|
|
|
|
|
|
|
|
|
const frameworks = [
|
2026-01-18 12:21:49 +08:00
|
|
|
|
{
|
|
|
|
|
|
name: 'LangChain / LangGraph',
|
|
|
|
|
|
learn: '中',
|
|
|
|
|
|
control: '高',
|
|
|
|
|
|
multi: '中',
|
|
|
|
|
|
use: '可控的工具调用、工作流、企业集成'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name: 'AutoGen',
|
|
|
|
|
|
learn: '中',
|
|
|
|
|
|
control: '中',
|
|
|
|
|
|
multi: '高',
|
|
|
|
|
|
use: '多 Agent 对话协作、编程/分析助手'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name: 'CrewAI',
|
|
|
|
|
|
learn: '低',
|
|
|
|
|
|
control: '中',
|
|
|
|
|
|
multi: '高',
|
|
|
|
|
|
use: '角色分工清晰的团队协作任务'
|
|
|
|
|
|
}
|
2026-01-15 20:10:19 +08:00
|
|
|
|
]
|
2026-01-16 19:10:21 +08:00
|
|
|
|
|
|
|
|
|
|
const best = computed(() => {
|
|
|
|
|
|
if (focus.value === 'start') return 'CrewAI'
|
|
|
|
|
|
if (focus.value === 'team') return 'AutoGen'
|
|
|
|
|
|
return 'LangChain / LangGraph'
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const reason = computed(() => {
|
2026-01-18 12:21:49 +08:00
|
|
|
|
if (focus.value === 'start')
|
|
|
|
|
|
return '概念更直观(角色+任务),适合先跑通一个最小团队。'
|
|
|
|
|
|
if (focus.value === 'team')
|
|
|
|
|
|
return '多 Agent 对话与协作是强项,适合需要分工的场景。'
|
2026-01-16 19:10:21 +08:00
|
|
|
|
return '把流程“画成图/写成步骤”,更利于调试、上线与长期维护。'
|
|
|
|
|
|
})
|
2026-01-15 20:10:19 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
2026-01-18 12:21:49 +08:00
|
|
|
|
.cmp {
|
|
|
|
|
|
border: 1px solid var(--vp-c-divider);
|
|
|
|
|
|
border-radius: 12px;
|
|
|
|
|
|
background: var(--vp-c-bg-soft);
|
|
|
|
|
|
padding: 16px;
|
|
|
|
|
|
margin: 20px 0;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
gap: 12px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.header {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
gap: 12px;
|
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
|
}
|
|
|
|
|
|
.title {
|
|
|
|
|
|
font-weight: 800;
|
|
|
|
|
|
}
|
|
|
|
|
|
.subtitle {
|
|
|
|
|
|
color: var(--vp-c-text-2);
|
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.focus {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
gap: 8px;
|
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
|
}
|
|
|
|
|
|
.chip {
|
|
|
|
|
|
border: 1px solid var(--vp-c-divider);
|
|
|
|
|
|
background: var(--vp-c-bg);
|
|
|
|
|
|
padding: 8px 12px;
|
|
|
|
|
|
border-radius: 999px;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
}
|
|
|
|
|
|
.chip.active {
|
|
|
|
|
|
border-color: var(--vp-c-brand);
|
|
|
|
|
|
color: var(--vp-c-brand);
|
|
|
|
|
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
|
|
|
|
|
|
}
|
2026-01-16 19:10:21 +08:00
|
|
|
|
|
2026-01-18 12:21:49 +08:00
|
|
|
|
.table {
|
|
|
|
|
|
background: var(--vp-c-bg);
|
|
|
|
|
|
border: 1px solid var(--vp-c-divider);
|
|
|
|
|
|
border-radius: 12px;
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
}
|
|
|
|
|
|
.row {
|
|
|
|
|
|
display: grid;
|
|
|
|
|
|
grid-template-columns: 1.4fr 0.8fr 0.8fr 0.9fr 2.1fr;
|
|
|
|
|
|
gap: 10px;
|
|
|
|
|
|
padding: 10px 12px;
|
|
|
|
|
|
border-top: 1px solid var(--vp-c-divider);
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
.row.head {
|
|
|
|
|
|
border-top: none;
|
|
|
|
|
|
font-weight: 800;
|
|
|
|
|
|
color: var(--vp-c-text-2);
|
|
|
|
|
|
background: var(--vp-c-bg-soft);
|
|
|
|
|
|
}
|
|
|
|
|
|
.name {
|
|
|
|
|
|
font-weight: 800;
|
|
|
|
|
|
}
|
|
|
|
|
|
.use {
|
|
|
|
|
|
color: var(--vp-c-text-2);
|
|
|
|
|
|
}
|
|
|
|
|
|
.row.best {
|
|
|
|
|
|
outline: 2px solid var(--vp-c-brand);
|
|
|
|
|
|
outline-offset: -2px;
|
|
|
|
|
|
background: rgba(0, 0, 0, 0.02);
|
|
|
|
|
|
}
|
2026-01-16 19:10:21 +08:00
|
|
|
|
|
2026-01-18 12:21:49 +08:00
|
|
|
|
.rec {
|
|
|
|
|
|
background: var(--vp-c-bg);
|
|
|
|
|
|
border: 1px dashed var(--vp-c-divider);
|
|
|
|
|
|
border-radius: 12px;
|
|
|
|
|
|
padding: 12px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.rec-title {
|
|
|
|
|
|
font-weight: 800;
|
|
|
|
|
|
margin-bottom: 6px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.rec-body {
|
|
|
|
|
|
color: var(--vp-c-text-2);
|
|
|
|
|
|
line-height: 1.6;
|
|
|
|
|
|
}
|
2026-01-15 20:10:19 +08:00
|
|
|
|
</style>
|