Skip to content

Commit a4732a8

Browse files
committed
feat: 完善文档
1 parent a12b753 commit a4732a8

File tree

2 files changed

+4
-26
lines changed

2 files changed

+4
-26
lines changed

packages/pro-components/chat/chat-actionbar/README.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,6 @@ isComponent: true
3535

3636
{{ comment }}
3737

38-
### 左右布局
39-
40-
{{ layout }}
41-
42-
### 按钮配置
43-
44-
{{ action }}
45-
46-
### 复制模式
47-
48-
copyMode对应复制内容的模式,可选 'markdown'(复制markdown原文)或 'text'(复制纯文本)
49-
50-
{{ copy }}
5138

5239
## API
5340
### ChatAction Props

packages/pro-components/chat/chat-message/README.md

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,11 @@ name | String / Slot / Function | '' | 自定义的昵称。支持字符串、
5757
datetime | String / Slot / Function | '' | 对话单元的时间配置。支持字符串、插槽或函数 | N
5858
variant | String | 'base' | 气泡框样式,支持基础、线框、文字三种类型。可选项:base/outline/text | N
5959
role | String | 'user' | 消息角色类型。可选项:user/assistant/system | N
60-
content | Array | [] | 消息内容。数组类型,数组中的每一项为一个消息内容对象。 | N
60+
content | Array | [] | 消息内容。数组类型,数组中的每一项为一个消息内容对象。类型定义见 Message | N
6161
placement | String | '' | 消息显示位置。可选项:left/right | N
6262
animation | String | 'skeleton' | 动画效果,支持「渐变加载动画」,「闪烁加载动画」, 「骨架屏」三种。可选项:skeleton/moving/gradient | N
6363
chatContentProps | Object | {} | 聊天内容组件的属性,[详细定义](./type.ts)| N
6464

65-
### ChatMessagesData 消息对象结构
66-
67-
字段 | 类型 | 必传 | 说明
68-
--|--|--|--
69-
role | `"user" \| "assistant" \| "system"` | Y | 消息角色类型
70-
status | `"pending" \| "streaming" \| "complete" \| "stop" \| "error"` | N | 消息状态
71-
content | `UserMessageContent[] \| AIMessageContent[] \| TextContent[] \| AttachmentContent[]` | N | 消息内容
72-
ext | any | N | 扩展字段
73-
7465
#### UserMessageContent 内容类型支持
7566
- 文本消息 (`TextContent`)
7667
- 附件消息 (`AttachmentContent`)
@@ -100,7 +91,7 @@ avatar | 自定义头像内容
10091
name | 自定义昵称内容
10192
datetime | 自定义时间内容
10293
actionbar | 自定义操作栏内容
103-
default | 默认插槽,用于自定义消息内容
94+
content | 默认插槽,用于自定义消息内容
10495

10596
### CSS Variables
10697

@@ -150,7 +141,7 @@ t-class-actions | 操作栏样式类
150141
</view>
151142
<view slot="name">AI助手</view>
152143
<view slot="datetime">刚刚</view>
153-
<view slot="default">
144+
<view slot="content">
154145
这是AI助手的回复内容
155146
</view>
156147
</t-chat-message>
@@ -160,7 +151,7 @@ t-class-actions | 操作栏样式类
160151

161152
```html
162153
<t-chat-message
163-
text-loading="{{true}}"
154+
status="pending"
164155
animation="skeleton"
165156
role="assistant"
166157
/>

0 commit comments

Comments
 (0)