ChatMessageMenu (消息菜单)
消息的右键 / 长按菜单:顶部一排快捷回应(可展开全部),下面是回复、引用、复制、编辑、置顶、删除、举报——哪些项出现由站点决定。
基础用法
快捷回应一排最多 7 个,更多的由右侧按钮展开成完整的选择器;↑↓ 在操作之间移动,←→ 在回应之间移动, Tab 在两组之间切换,Esc 关闭。
雪之下小春:
周末的线下聚会你去吗?
右键点击上面的消息Basic.vue
属性
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| visible * | boolean | — | Whether the menu is open. It asks to close — Escape, a click outside, the page scrolling, a choice made — by emitting `close`. |
| actions | KunChatMessageAction[] | ["reply", "copy"] | The actions, in order: built-in keys, or items of your own. |
| currentReaction | string | null | null | The viewer's current reaction on the message, highlighted. |
| position | { x: number; y: number; } | null | { x: 0, y: 0 } | Viewport point to open at — the cursor, or the long-press point. |
| quickReactions | number | 7 | How many reactions the row shows before the expand button. |
| reactions | KunChatReactionOption[] | [] | The quick-reaction row on top; empty hides it. |
事件
| 事件 | 回调参数 | 说明 |
|---|---|---|
| close | — | The menu closed, for any reason. |
| react | reaction: string | null | A reaction was chosen: its key, or null when the current one was chosen again. |
| select | action: string | An action was chosen: a built-in key or one of your own items' keys. |