Skip to content

Commit c7c48e7

Browse files
author
weilei
committed
fix(docs): 更新 ThoughtChain 组件文档
1 parent 6a58cbb commit c7c48e7

File tree

1 file changed

+50
-47
lines changed

1 file changed

+50
-47
lines changed

docs/src/components/thought-chain.md

Lines changed: 50 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,24 @@
3434
thinkingItems: [
3535
{
3636
id: 1,
37-
title: "第一步",
38-
thinkTitle: "理解问题",
39-
thinkContent: "分析用户需求的核心要点",
40-
status: "success",
37+
title: '第一步',
38+
thinkTitle: '理解问题',
39+
thinkContent: '分析用户需求的核心要点',
40+
status: 'success',
4141
},
4242
{
4343
id: 2,
44-
title: "第二步",
45-
thinkTitle: "收集信息",
46-
thinkContent: "从知识库中检索相关信息",
47-
status: "success",
44+
title: '第二步',
45+
thinkTitle: '收集信息',
46+
thinkContent: '从知识库中检索相关信息',
47+
status: 'success',
4848
},
4949
{
5050
id: 3,
51-
title: "第三步",
52-
thinkTitle: "生成回答",
53-
thinkContent: "基于收集的信息构建回答",
54-
status: "loading",
51+
title: '第三步',
52+
thinkTitle: '生成回答',
53+
thinkContent: '基于收集的信息构建回答',
54+
status: 'loading',
5555
},
5656
],
5757
};
@@ -75,6 +75,7 @@
7575
:thinking-items="thinkingItems"
7676
:line-gradient="true"
7777
dot-size="small"
78+
@handle-expand="expandChange"
7879
/>
7980
</div>
8081
</template>
@@ -86,24 +87,32 @@
8687
thinkingItems: [
8788
{
8889
id: 1,
89-
title: "分析阶段",
90-
thinkTitle: "问题分解",
91-
thinkContent: "将复杂问题拆解为多个子问题",
90+
title: '分析阶段',
91+
thinkTitle: '问题分解',
92+
thinkContent: '将复杂问题拆解为多个子问题',
9293
isCanExpand: true,
9394
isDefaultExpand: true,
94-
status: "success",
95+
status: 'success',
9596
},
9697
{
9798
id: 2,
98-
title: "推理阶段",
99-
thinkTitle: "逻辑推理",
100-
thinkContent: "基于子问题逐步推导解决方案",
99+
title: '推理阶段',
100+
thinkTitle: '逻辑推理',
101+
thinkContent: '基于子问题逐步推导解决方案',
101102
isCanExpand: true,
102-
status: "success",
103+
status: 'success',
103104
},
104105
],
105106
};
106107
},
108+
methods: {
109+
testHandleExpand(item) {
110+
console.log(item);
111+
},
112+
change(item) {
113+
console.log('change', item);
114+
},
115+
},
107116
};
108117
</script>
109118
```
@@ -133,39 +142,39 @@
133142
return {
134143
customStatusEnum: {
135144
loading: {
136-
value: "processing",
137-
type: "primary",
145+
value: 'processing',
146+
type: 'primary',
138147
},
139148
error: {
140-
value: "failed",
141-
type: "danger",
149+
value: 'failed',
150+
type: 'danger',
142151
},
143152
success: {
144-
value: "completed",
145-
type: "success",
153+
value: 'completed',
154+
type: 'success',
146155
},
147156
},
148157
thinkingItems: [
149158
{
150159
id: 1,
151-
title: "数据收集",
152-
status: "completed",
153-
thinkTitle: "收集用户数据",
154-
thinkContent: "从数据库获取用户历史记录",
160+
title: '数据收集',
161+
status: 'completed',
162+
thinkTitle: '收集用户数据',
163+
thinkContent: '从数据库获取用户历史记录',
155164
},
156165
{
157166
id: 2,
158-
title: "分析处理",
159-
status: "processing",
160-
thinkTitle: "分析用户行为",
161-
thinkContent: "使用机器学习模型分析用户偏好",
167+
title: '分析处理',
168+
status: 'processing',
169+
thinkTitle: '分析用户行为',
170+
thinkContent: '使用机器学习模型分析用户偏好',
162171
},
163172
{
164173
id: 3,
165-
title: "生成结果",
166-
status: "failed",
167-
thinkTitle: "生成推荐",
168-
thinkContent: "由于数据不足,无法生成准确推荐",
174+
title: '生成结果',
175+
status: 'failed',
176+
thinkTitle: '生成推荐',
177+
thinkContent: '由于数据不足,无法生成准确推荐',
169178
},
170179
],
171180
};
@@ -213,14 +222,8 @@ thinkingItems 数组中每个对象可包含以下字段:
213222
| iconColor | 节点图标颜色(dotIsIcon 为 true 时生效) | String | '' |
214223
| iconSize | 节点图标大小(dotIsIcon 为 true 时生效) | String | 'normal'/'large' |
215224

216-
## 方法
217-
218-
| 方法名 | 说明 | 参数 | 返回值 |
219-
| ------------ | ------------------------- | ---------------- | ------ |
220-
| handleExpand | 处理折叠面板展开/收起事件 | item: 当前思考项 | - |
221-
222225
## 事件
223226

224-
| 事件名 | 说明 | 回调参数 |
225-
| ------------ | ------------------------- | -------------- |
226-
| handleExpand | 当思考项被展开/收起时触发 | 当前思考项对象 |
227+
| 事件名 | 说明 | 回调参数 |
228+
| ------------- | ------------------------- | -------------- |
229+
| handle-expand | 当思考项被展开/收起时触发 | 当前思考项对象 |

0 commit comments

Comments
 (0)