Bubble 对话气泡
使用 |
文档 |
何时使用#
常用于聊天的时候。
代码演示 #
hello world!
加载中
Good morning, how are you?
What a beautiful day!
Hi, good morning, I'm fine!
Thank you!
加载中
加载中
Ant Design X love you!
Ant Design X love you!
加载中
Render as markdown content to show rich text!
Link: Ant Design X
加载中
variant: filled
variant: outlined
variant: shadow
prompt
加载中
shape: default
This is a long text message to show the multiline view of the bubble component. This is a long text message to show the multiline view of the bubble component. This is a long text message to show the multiline view of the bubble component.
shape: round
This is a long text message to show the multiline view of the bubble component. This is a long text message to show the multiline view of the bubble component. This is a long text message to show the multiline view of the bubble component.
shape: corner
This is a long text message to show the multiline view of the bubble component. This is a long text message to show the multiline view of the bubble component. This is a long text message to show the multiline view of the bubble component.
加载中
Mock user content.
Mock AI content. Mock AI content. Mock AI content. Mock AI content. Mock AI content. Mock AI content. Mock AI content. Mock AI content. Mock AI content. Mock AI content. Mock AI content. Mock AI content. Mock AI content. Mock AI content. Mock AI content. Mock AI content. Mock AI content. Mock AI content. Mock AI content. Mock AI content.
加载中
Mock welcome content. Mock welcome content. Mock welcome content. Mock welcome content. Mock welcome content. Mock welcome content. Mock welcome content. Mock welcome content. Mock welcome content. Mock welcome content.
Mock user content.
加载中
API#
nx-bubble#
| Property | Description | Type | Default |
|---|---|---|---|
[nxContent] | 气泡内容 | string | '' |
[nxMessageRender] | 自定义消息渲染模板 | TemplateRef<{ content: string }> | null | null |
[nxAvatar] | 头像组件或属性 | NxBubbleAvatar | - |
[nxHeader] | 气泡头部内容 | string | TemplateRef<void> | null | null |
[nxFooter] | 气泡底部内容 | string | TemplateRef<void> | null | null |
[nxLoading] | 加载状态 | boolean | - |
[nxLoadingRender] | 自定义加载状态渲染模板 | TemplateRef<void> | null | null |
[nxPlacement] | 气泡位置 | NxBubblePlacement | 'start' |
[nxShape] | 气泡形状 | NxBubbleShape | 'default' |
[nxTyping] | 打字机效果配置 | boolean | NxTypingOption | DEFAULT_TYPING_OPTION |
[nxVariant] | 气泡变体 | NxBubbleVariant | 'filled' |
(nxContentUpdate) | 内容更新时触发的回调 | EventEmitter<void> | - |
(nxTypingComplete) | 打字机效果完成时触发的回调 | EventEmitter<void> | - |
nx-bubble-list#
| Property | Description | Type | Default |
|---|---|---|---|
[nxAutoScroll] | 是否在内容更新时自动滚动到最新位置 | boolean | true |
[nxItems] | 气泡列表项 | NxBubbleListItem[] | 必填 |
[nxRoles] | 设置气泡的默认属性,role 会自动匹配 | NxBubbleRoles | - |
interface NxBubbleListItem {
key?: string;
role?: string;
content?: string;
loading?: boolean;
placement?: NxBubblePlacement;
shape?: NxBubbleShape;
variant?: NxBubbleVariant;
typing?: boolean | NxTypingOption;
avatar?: NxBubbleAvatar;
headerRender?: TemplateRef<{ content: string; info: { key?: string } }> | null;
footerRender?: TemplateRef<{ content: string; info: { key?: string } }> | null;
messageRender?: TemplateRef<{ content: string }> | null;
loadingRender?: TemplateRef<void> | null;
}