Skip to content

Thinking / ThoughtChain 思考链

展示 AI 的逐步推理过程(类似 OpenAI o1 / DeepSeek R1 的思考过程)。

在线演示

Thinking — 单步思考

Prop类型默认值说明
titlestring''思考步骤标题
contentstring''思考内容(Markdown)
status'pending' | 'loading' | 'success' | 'error''loading'步骤状态
loadingTextstring'思考中...'加载中文案
durationnumberundefined耗时(ms)
expandedbooleanfalse默认展开

ThoughtChain — 思考链

Prop类型默认值说明
itemsThinkingItem[][]思考步骤列表
expandedbooleanfalse默认全部展开
accordionbooleanfalse手风琴模式(同时只展开一项)

用法

vue
<ThoughtChain :items="[
  { title: '分析问题', content: '用户询问…', status: 'success', duration: 230 },
  { title: '检索知识库', content: '正在搜索…', status: 'loading' },
  { title: '生成回答', content: '', status: 'pending' },
]" />

自定义渲染

vue
<ThoughtChain :items="thinkingSteps">
  <template #default="{ item, index }">
    <div class="my-thinking-step">
      <span :class="`status-dot status-dot--${item.status}`" />
      <div>
        <strong>{{ item.title }}</strong>
        <small v-if="item.duration">{{ item.duration }}ms</small>
      </div>
      <div v-if="item.expanded" v-html="item.content" />
    </div>
  </template>
</ThoughtChain>