QuireKit
浏览组件

Comment

在文档页边呈现评论会话、新建评论,并让卡片贴近所评论的原文。

CommentThread 呈现一条评论会话,CommentDraft 用于新建评论,CommentRail 把卡片排列在所评论原文的高度上。三者只负责呈现与交互,评论数据、权限和保存由使用方提供。

评论会话

messages 的第一条是发起评论,其余是回复;quote 是被评论的原文。active 时展开全部回复并显示回复框;resolvable、replyable 决定是否提供解决与回复。可编辑、可删除由每条消息的 editable、deletable 决定,删除第一条即删除整条评论。传入 position({ index, total })时,选中的卡片在标题栏显示上一条 / 下一条按钮和“2 / 5”这样的位置,分别触发 previous、next;只有一条时不显示。⌘/Ctrl + Enter 发送,Esc 取消。

这里的发布时间和公告不一致,需要确认。
林舟
已与运营核对,以公告为准。

状态

未激活时只显示第一条和回复数量。resolved 使用浅底并标记已解决。quote-state 区分位置评论(point)、原文已删除(deleted)与找不到原文(unavailable)。

请补充数据来源。
请补充数据来源。
已解决
请补充数据来源。
请补充数据来源。
请补充数据来源。

由宿主保存草稿与编辑

绑定 v-model:reply-draft 与 v-model:reply-open 后,回复草稿由宿主保存,切换线程再回来仍能恢复;发送后由宿主清空。绑定 editing-id 并提供 #editor 插槽可换成自己的编辑器,例如富文本编辑;保存和取消都通过修改 editing-id 完成。quote-label 改写无原文时的标签,以匹配产品用词。

actions 插槽把宿主自己的按钮放进卡片头部,排在“解决”之前。用 QuireCommentAction 传入 label 和 icon,样式与内置按钮一致,并自带 Tooltip。

标题建议改短一些。

宿主保存的草稿:(空)

新建评论

CommentDraft 打开时聚焦输入框,submit 返回正文,cancel 放弃。

林舟
把发布窗口调整到周二上午

页边排列

items 按文档顺序给出每张卡片锚点的高度。卡片落在锚点处;与上一张重叠时向下推开,间距由 gap 设置。height 通常传文档高度,卡片超出时栏高随之增加。

目标用户:中小团队的项目负责人。

核心场景:在一份文档里完成需求、讨论与决策。

相邻的两条评论锚点很近,第二张卡片被推到第一张下方;第三条保持在自己的位置。

风险:依赖的接口还没有排期。

是否包含企业管理员?
建议补一个离线场景。
依赖的接口还没有排期。

API

QuireCommentThread Props

Slots 内容位置

body

Formatted message content; defaults to plain text with preserved line breaks.

editor

Replaces the built-in plain-text editor, e.g. with a rich editor; the host saves and cancels through `editingId`.

actions

Host controls placed before resolve in the card header, usually small icon buttons.

Events 组件事件

update:editingId

更新 editingId,可通过对应 v-model 绑定。

[value: string | null]
update:replyDraft

更新 replyDraft,可通过对应 v-model 绑定。

[value: string]
update:replyOpen

更新 replyOpen,可通过对应 v-model 绑定。

[value: boolean]
activate
[]
resolve
[]
reopen
[]
reply
[body: string, mentions: readonly QuireKitCommentMention[]]
edit
[messageId: string, body: string, mentions: readonly QuireKitCommentMention[]]
delete
[messageId: string]
previous
[]
next
[]

QuireCommentDraft Props

Slots 内容位置

无公开插槽。

Events 组件事件

submit
[body: string, mentions: readonly QuireKitCommentMention[]]
cancel
[]

QuireCommentRail Props

Slots 内容位置

item

One card; positioned by the rail at its anchor or just below the previous card.

Events 组件事件

无自定义事件。