# ThoughtChain
# Features
The ThoughtChain component is used to display the steps and logical chain of an AI's thinking process, supporting the following features:
- Collapsible thinking steps
- Markdown content rendering
- Logical connection display between steps
- Interactive display of the thinking process
- Custom timeline styles and icons
- Support for loading, error, and success status displays
- Gradient color timeline support
# Usage Examples
# Basic Usage
Displays a basic thought chain component with multiple thinking steps.
Copy
# Collapsible Thinking Steps
Displays detailed thinking content that can be collapsed and expanded.
Copy
# Custom Status and Styles
Customize the status and display style of the thinking steps.
Copy
# Component Attributes
Attribute | Description | Type | Default Value |
---|---|---|---|
thinkingItems | Array of thinking items, each containing information about a thinking step. | Array | [] |
dotSize | Size of the timeline node, can be 'mini'/'small'/'medium', or empty, consistent with el-button 's size . | String | 'small' |
maxWidth | Maximum width of the component. | String | '600px' |
lineGradient | Whether to enable gradient color effect for the timeline. | Boolean | false |
rowKey | Specifies the unique identifier field for each item in thinkingItems . | String | 'id' |
statusKey | Specifies the status field in thinkingItems . | String | 'status' |
statusEnum | Status enumeration configuration, including loading/error/success states. | Object | { loading: { value: 'loading', type: 'warning' }, error: { value: 'error', type: 'danger' }, success: { value: 'success', type: 'success' } } |
titleKey | Specifies the title field in thinkingItems . | String | 'title' |
thinkTitleKey | Specifies the thinking title field in thinkingItems . | String | 'thinkTitle' |
thinkContentKey | Specifies the thinking content field in thinkingItems . | String | 'thinkContent' |
dotIsIcon | Whether to use an icon instead of the default node. If true, icon /iconColor /iconSize can be set in thinkingItems . | Boolean | false |
# thinkingItems
Field Descriptions
Each object in the thinkingItems
array can contain the following fields:
Field Name | Description | Type | Options/Default Value |
---|---|---|---|
id | Unique identifier for the thinking item. | String/Number | Required |
title | Title of the thinking item. | String | Required |
thinkTitle | Thinking title of the item. | String | Optional |
thinkContent | Detailed content of the item. | String | Optional |
status | Status of the item. | String | 'loading'/'success'/'error' or custom status |
isCanExpand | Whether the item can be expanded. | Boolean | false |
isDefaultExpand | Whether the item is expanded by default. | Boolean | false |
hideTitle | Whether to hide the title. | Boolean | false |
placement | Position of the timeline item. | String | 'top'/'bottom' |
isMarkdown | Whether the content is in Markdown format. | Boolean | false |
typing | Whether to enable the typewriter effect. | Boolean/Object | false or {interval: 50, step: 1, suffix: " |
icon | Node icon class name (effective when dotIsIcon is true). | String | 'el-icon-more' |
iconColor | Node icon color (effective when dotIsIcon is true). | String | '' |
iconSize | Node icon size (effective when dotIsIcon is true). | String | 'normal'/'large' |
# Events
Event Name | Description | Callback Parameters |
---|---|---|
handle-expand | Triggered when a thinking item is expanded/collapsed. | The current thinking item object |