Skip to content

Commit f3bdc9f

Browse files
committed
fix(chat): update demo and document for conversations
1 parent 6afd36f commit f3bdc9f

File tree

2 files changed

+24
-25
lines changed

2 files changed

+24
-25
lines changed

src/chat/demos/components/customConversationItem.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import React from 'react';
22
import { Input, message } from 'antd';
33
import classNames from 'classnames';
4-
5-
import Conversation from '../../conversations';
6-
import { IConversationsItemProps } from '../../conversations/Item';
4+
import { Chat } from 'dt-react-component';
5+
import { IConversationsItemProps } from 'dt-react-component/chat/conversations/Item';
76

87
interface IProps extends IConversationsItemProps {
98
edit?: IConversationsItemProps['info'];
@@ -52,6 +51,6 @@ export default function CustomConversionItem(props: IProps) {
5251
/>
5352
</div>
5453
) : (
55-
<Conversation.Item {...props} />
54+
<Chat.Conversations.Item {...props} />
5655
);
5756
}

src/chat/index.$tab-conversations.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,27 @@ Conversations 组件用于展示会话列表
1818

1919
## API
2020

21-
| 参数 | 说明 | 类型 | 默认值 |
22-
| ---------------- | ----------------- | ----------------------------------------------------------------------------------- | ---------- | --- |
23-
| conversations | 会话列表 | `ConversationInfo[]` | - |
24-
| activeKey | 激活的会话 ID | `ConversationInfo['id']` | - |
25-
| defaultActiveKey | 默认激活的会话 ID | `ConversationInfo['id']` | - |
26-
| dropdown | 下拉菜单 | [IConversationsItemProps](?tab=conversations#iconversationsitemprops)`['dropdown']` | - |
27-
| groupable | 是否启用分组 | `boolean` | Groupable` | - |
28-
| className | 自定义类名 | `string` | - |
29-
| style | 自定义样式 | `React.CSSProperties` | - |
30-
| loading | 是否加载中 | `boolean` | - |
31-
| header | 会话列表头部 | `React.ReactNode` | boolean` | - |
32-
| collapsed | 是否折叠 | `boolean` | - |
33-
| onItemClick | 点击会话事件 | `(info: ConversationInfo) => void` | - |
34-
| renderItem | 自定义渲染会话项 | `(props: IConversationsItemProps) => React.ReactNode` | - |
21+
| 参数 | 说明 | 类型 | 默认值 |
22+
| ---------------- | ----------------- | ----------------------------------------------------------------------------------- | ------- |
23+
| conversations | 会话列表 | `ConversationInfo[]` | - |
24+
| activeKey | 激活的会话 ID | `ConversationInfo['id']` | - |
25+
| defaultActiveKey | 默认激活的会话 ID | `ConversationInfo['id']` | - |
26+
| dropdown | 下拉菜单 | [IConversationsItemProps](?tab=conversations#iconversationsitemprops)`['dropdown']` | `false` |
27+
| groupable | 是否启用分组 | `boolean` | - |
28+
| className | 自定义类名 | `string` | - |
29+
| style | 自定义样式 | `React.CSSProperties` | - |
30+
| loading | 是否加载中 | `boolean` | - |
31+
| header | 会话列表头部 | `React.ReactNode` | - |
32+
| collapsed | 是否折叠 | `boolean` | `true` |
33+
| onItemClick | 点击会话事件 | `(info: ConversationInfo) => void` | - |
34+
| renderItem | 自定义渲染会话项 | `(props: IConversationsItemProps) => React.ReactNode` | - |
3535

3636
## IConversationsItemProps
3737

38-
| 参数 | 说明 | 类型 | 默认值 |
39-
| --------- | -------- | ----------------------------------------------- | ----------------------------------------------------------------------------------------------- | --- |
40-
| info | 对话数据 | `ConversationInfo[]` | - |
41-
| active | 是否激活 | `boolean` | - |
42-
| dropdown | 下拉菜单 | `DropdownProps & { triggerDom?: React.ReactNode | ((conversation: ConversationInfo, info: { originNode: React.ReactNode }) => React.ReactNode) }` | - |
43-
| prefixCls | 前缀 | `string` | - |
44-
| onClick | 点击事件 | `(conversation: ConversationInfo) => void` | - |
38+
| 参数 | 说明 | 类型 | 默认值 |
39+
| --------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------- |
40+
| info | 对话数据 | `ConversationInfo[]` | - |
41+
| active | 是否激活 | `boolean` | - |
42+
| dropdown | 下拉菜单 | `DropdownProps & { triggerDom?: React.ReactNode \| ((conversation: ConversationInfo, info: { originNode: React.ReactNode }) => React.ReactNode) }` | - |
43+
| prefixCls | 前缀 | `string` | `dtc-conversations` |
44+
| onClick | 点击事件 | `(conversation: ConversationInfo) => void` | - |

0 commit comments

Comments
 (0)