feat(评论组件): 在回复编辑器中添加用户信息输入支持

当用户首次评论或缺少昵称/邮箱时,在回复编辑器中显示用户信息输入框。修改了CWDComments、CommentList、CommentItem和ReplyEditor组件,通过currentUser和onUpdateUserInfo属性传递用户数据和更新回调,确保用户信息在回复过程中可收集和更新。
This commit is contained in:
anghunk
2026-01-23 20:02:02 +08:00
parent ee646506a9
commit 9bf0764476
4 changed files with 69 additions and 3 deletions

View File

@@ -366,6 +366,8 @@ export class CWDComments {
replyContent: state.replyContent,
replyError: state.replyError,
submitting: state.submitting,
currentUser: state.form,
onUpdateUserInfo: (field, value) => this.store.updateFormField(field, value),
adminEmail: this.config.adminEmail,
adminBadge: this.config.adminBadge,
enableCommentLike: this.config.enableCommentLike !== false,
@@ -492,6 +494,7 @@ export class CWDComments {
replyContent: state.replyContent,
replyError: state.replyError,
submitting: state.submitting,
currentUser: state.form,
});
}
}