From 7bf71eb919dead63d8325caa5e1d4efb8e2ffb25 Mon Sep 17 00:00:00 2001 From: ruibaby Date: Sun, 29 Dec 2019 20:49:32 +0800 Subject: [PATCH] fix: comments cannot be replied to. --- src/views/comment/components/TargetCommentDrawer.vue | 8 +------- src/views/comment/components/TargetCommentTree.vue | 10 +++++----- src/views/user/Login.vue | 2 +- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/views/comment/components/TargetCommentDrawer.vue b/src/views/comment/components/TargetCommentDrawer.vue index 5b01954d8..ef56dea8e 100644 --- a/src/views/comment/components/TargetCommentDrawer.vue +++ b/src/views/comment/components/TargetCommentDrawer.vue @@ -156,13 +156,7 @@ export default { this.selectedComment = comment this.replyCommentVisible = true this.replyComment.parentId = comment.id - if (this.type === 'posts') { - this.replyComment.postId = comment.post.id - } else if (this.type === 'sheets') { - this.replyComment.postId = comment.sheet.id - } else { - this.replyComment.postId = comment.journal.id - } + this.replyComment.postId = this.id }, handleCreateClick() { if (!this.replyComment.content) { diff --git a/src/views/comment/components/TargetCommentTree.vue b/src/views/comment/components/TargetCommentTree.vue index 644eddf41..bb0efb03c 100644 --- a/src/views/comment/components/TargetCommentTree.vue +++ b/src/views/comment/components/TargetCommentTree.vue @@ -22,7 +22,7 @@ 回复 @@ -114,8 +114,8 @@ export default { } }, methods: { - handleReplyClick() { - this.$emit('reply', this.comment) + handleReplyClick(comment) { + this.$emit('reply', comment) }, handleEditStatusClick(comment, status) { this.$emit('editStatus', comment, status) diff --git a/src/views/user/Login.vue b/src/views/user/Login.vue index 1582dd8f4..4e1f7d98c 100644 --- a/src/views/user/Login.vue +++ b/src/views/user/Login.vue @@ -81,7 +81,7 @@