@deprecated rtk-chat-message 已弃用并即将移除。请改用 rtk-message-view。
| 属性 | 类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
alignRight |
boolean |
✅ | - | 将消息靠右对齐 |
canDelete |
boolean |
✅ | - | 是否可以删除消息 |
canEdit |
boolean |
✅ | - | 是否可以编辑消息 |
canPin |
boolean |
✅ | - | 是否可以置顶该消息 |
canReply |
boolean |
✅ | - | 是否可以引用回复该消息 |
child |
HTMLElement |
✅ | - | 子元素 |
disableControls |
boolean |
✅ | - | 禁用控件 |
hideAvatar |
boolean |
✅ | - | 隐藏头像 |
iconPack |
IconPack1 |
❌ | defaultIconPack |
图标包 |
isContinued |
boolean |
✅ | - | 是否为连续发送的消息 |
isSelf |
boolean |
✅ | - | 发送者是否为自己 |
isUnread |
boolean |
✅ | - | 是否未读 |
leftAlign |
boolean |
✅ | - | 是否左对齐聊天气泡 |
message |
Message |
✅ | - | 消息项 |
senderDisplayPicture |
string |
✅ | - | 发送者显示头像 URL |
size |
Size |
✅ | - | 大小 |
t |
RtkI18n1 |
❌ | useLanguage() |
语言 |
import { RtkChatMessage } from '@cloudflare/realtimekit-react-ui';
function MyComponent() {
return <RtkChatMessage />;
}import { RtkChatMessage } from '@cloudflare/realtimekit-react-ui';
function MyComponent() {
return (
<RtkChatMessage
alignRight={true}
canDelete={true}
canEdit={true}
/>
);
}