Skip to main content

Module section

Module section 

Source
Expand description

评论区段组件。 评论区段组件

管理单篇文章的评论上下文(回复目标、刷新触发器、待审核评论), 负责加载评论列表、轮询待审核评论状态并渲染表单与列表。

Structs§

CommentContext
评论上下文,供评论相关组件共享状态。
CommentSectionContentProps 🔒
Props for the CommentSectionContent component.
CommentSectionProps
Props for the CommentSection component.
CommentSubmission
表单交给 CommentContext::submit 的评论内容。

Enums§

ListState 🔒
列表区的展示状态(只在状态切换时重建对应分支)。

Constants§

PENDING_POLL_INTERVAL_MS 🔒
待审核评论状态的轮询间隔(毫秒)。

Functions§

CommentSection
评论区段组件。
CommentSectionContent 🔒
正式文章和图鉴共同使用的评论区展示;数据获取与持久化由上层负责。
poll_pending 🔒
轮询待审核评论状态:只要本地还有待审核评论,就定期查询其审核状态。
submit_to_server 🔒
提交到服务端;匿名评论成功后保存作者信息并写入本地待审核列表。

Type Aliases§

CommentSubmitFuture
评论提交结果:Ok 为成功提示,Err 为失败提示。