| 属性 | 类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
actions |
MessageAction[] |
✅ | - | 在菜单中显示的操作列表 |
authorName |
string |
✅ | - | 作者显示名称 |
avatarUrl |
string |
✅ | - | 头像图片 URL |
hideAuthorName |
boolean |
✅ | - | 隐藏作者显示名称 |
hideAvatar |
boolean |
✅ | - | 隐藏头像 |
hideMetadata |
boolean |
✅ | - | 隐藏元数据(时间) |
iconPack |
IconPack1 |
❌ | defaultIconPack |
图标包 |
isEdited |
boolean |
✅ | - | 消息是否已被编辑 |
isSelf |
boolean |
✅ | - | 是否为当前用户发送的消息 |
messageType |
Message['type'] |
✅ | - | 消息类型 |
pinned |
boolean |
✅ | - | 消息是否已被置顶 |
time |
Date |
✅ | - | 消息发送时间 |
variant |
'plain' | 'bubble' |
✅ | - | 外观样式 |
viewType |
'incoming' | 'outgoing' |
✅ | - | 渲染方向 |
<rtk-message-view></rtk-message-view><rtk-message-view
authorName="example"
avatarUrl="example">
</rtk-message-view><script>
const el = document.querySelector("rtk-message-view");
el.actions= [];
</script>