|
| 1 | +<view class="navigation-bar" /> |
| 2 | + |
| 3 | +<ant-container title="基础用法"> |
| 4 | + <ant-bubble content="这是一条普通消息" avatar="https://gw.alipayobjects.com/mdn/rms_226d75/afts/img/A*5m0ZQYhxhjEAAAAAAAAAAAAAARQnAQ" /> |
| 5 | +</ant-container> |
| 6 | + |
| 7 | +<ant-container title="打字动画"> |
| 8 | + <ant-switch checked="{{ showTyping }}" onChange="onTypingChange" /> |
| 9 | + <block a:if="{{ showTyping }}"> |
| 10 | + <ant-bubble content="你好,这是一段打字效果动画" typing="{{true}}" onTypingComplete="onTypingComplete" /> |
| 11 | + <ant-bubble content="你好,这是一段快速的打字效果动画" typing="{{{ step: 1, interval: 50 }}}" onTypingComplete="onTypingComplete" /> |
| 12 | + <ant-bubble content="这是一段很长的文本消息,用于测试打字效果动画。该条消息会一次打印多个字符" typing="{{{ step: 3, interval: 100 }}}" onTypingComplete="onTypingComplete" /> |
| 13 | + </block> |
| 14 | +</ant-container> |
| 15 | +<ant-container title="用户消息"> |
| 16 | + <ant-bubble content="这是用户发送的消息" placement="end" avatar="https://gw.alipayobjects.com/mdn/rms_226d75/afts/img/A*5m0ZQYhxhjEAAAAAAAAAAAAAARQnAQ" /> |
| 17 | +</ant-container> |
| 18 | + |
| 19 | +<ant-container title="长文本"> |
| 20 | + <ant-bubble |
| 21 | + content="这是一段很长的文本消息,用于测试气泡的自动换行效果。气泡会根据内容自动调整宽度,这样可以保证良好的阅读体验。" |
| 22 | + avatar="https://gw.alipayobjects.com/mdn/rms_226d75/afts/img/A*5m0ZQYhxhjEAAAAAAAAAAAAAARQnAQ" |
| 23 | + /> |
| 24 | +</ant-container> |
| 25 | + |
| 26 | +<ant-container title="对话场景"> |
| 27 | + <ant-bubble content="你好,请问有什么可以帮你?" avatar="https://gw.alipayobjects.com/mdn/rms_226d75/afts/img/A*5m0ZQYhxhjEAAAAAAAAAAAAAARQnAQ" /> |
| 28 | + <ant-bubble content="我想了解一下这个产品的功能" placement="end" avatar="https://gw.alipayobjects.com/mdn/rms_226d75/afts/img/A*5m0ZQYhxhjEAAAAAAAAAAAAAARQnAQ" /> |
| 29 | + <ant-bubble content="好的,这个产品主要有以下功能..." avatar="https://gw.alipayobjects.com/mdn/rms_226d75/afts/img/A*5m0ZQYhxhjEAAAAAAAAAAAAAARQnAQ" /> |
| 30 | +</ant-container> |
| 31 | + |
| 32 | +<!-- 各种形状 --> |
| 33 | +<ant-container title="各种形状"> |
| 34 | + <ant-bubble content="shape: default" shape="default" /> |
| 35 | + <ant-bubble content="shape: round" shape="round" /> |
| 36 | + <ant-bubble content="shape: corner" shape="corner" placement="end" /> |
| 37 | + <ant-bubble content="variant: borderless" variant="borderless" /> |
| 38 | + <ant-bubble content="variant: outlined" variant="outlined" /> |
| 39 | + <ant-bubble content="variant: shadow" variant="shadow" /> |
| 40 | +</ant-container> |
| 41 | + |
| 42 | +<ant-container title="用户名"> |
| 43 | + <ant-bubble content="你好,请问有什么可以帮你?" avatar="https://gw.alipayobjects.com/mdn/rms_226d75/afts/img/A*5m0ZQYhxhjEAAAAAAAAAAAAAARQnAQ"> |
| 44 | + <view slot="header"> |
| 45 | + <text class="ant-copilot-bubble-name">Ant Design Mini</text> |
| 46 | + </view> |
| 47 | + </ant-bubble> |
| 48 | +</ant-container> |
| 49 | + |
| 50 | +<ant-container title="加载中"> |
| 51 | + <ant-switch checked="{{ loading }}" onChange="onSwitchChange" /> |
| 52 | + <ant-bubble content="你好,这是一段加载后显示的内容" loading="{{loading}}" /> |
| 53 | + <ant-bubble content="你好,这是一段加载后显示的内容,同时附带打字效果" loading="{{loading}}" typing="{{true}}" /> |
| 54 | +</ant-container> |
| 55 | + |
| 56 | +<ant-container title="自定义内容"> |
| 57 | + <ant-bubble placement="end"> |
| 58 | + <view>这是一段图文组合消息</view> |
| 59 | + <image class="ant-copilot-bubble-image" src="https://gw.alipayobjects.com/mdn/rms_226d75/afts/img/A*5m0ZQYhxhjEAAAAAAAAAAAAAARQnAQ" /> |
| 60 | + </ant-bubble> |
| 61 | +</ant-container> |
| 62 | + |
0 commit comments