Skip to content

Commit 9ca821c

Browse files
author
weilei
committed
feat(examples): 添加自定义状态枚举及状态项支持
1 parent 0acd25f commit 9ca821c

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

examples/src/views/ThoughtChain.vue

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@
5959
</div>
6060
<el-x-thought-chain :thinking-items="iconItems" :dot-is-icon="dotIsIcon" class="mt-10" />
6161
</div>
62+
63+
<div class="demo-block">
64+
<h3>自定义状态枚举</h3>
65+
<el-x-thought-chain :thinking-items="customStatusItems" :status-enum="customStatusEnum" class="mt-10" />
66+
</div>
6267
</el-card>
6368
</div>
6469
</template>
@@ -172,6 +177,43 @@ export default {
172177
},
173178
],
174179
dotIsIcon: false,
180+
customStatusEnum: {
181+
loading: {
182+
value: 'processing',
183+
type: 'primary',
184+
},
185+
error: {
186+
value: 'failed',
187+
type: 'danger',
188+
},
189+
success: {
190+
value: 'completed',
191+
type: 'success',
192+
},
193+
},
194+
customStatusItems: [
195+
{
196+
id: 1,
197+
title: '处理中状态',
198+
status: 'processing',
199+
thinkTitle: '正在处理中...',
200+
thinkContent: '这是处理中的详细内容',
201+
},
202+
{
203+
id: 2,
204+
title: '已完成状态',
205+
status: 'completed',
206+
thinkTitle: '处理完成',
207+
thinkContent: '这是处理完成的详细内容',
208+
},
209+
{
210+
id: 3,
211+
title: '失败状态',
212+
status: 'failed',
213+
thinkTitle: '处理失败',
214+
thinkContent: '处理过程中出现了错误',
215+
},
216+
],
175217
}
176218
},
177219
watch: {

0 commit comments

Comments
 (0)