From 13f9eecaf32035907a37280cc97e080c82cb73ef Mon Sep 17 00:00:00 2001 From: kimdaae328 Date: Tue, 25 Feb 2025 11:10:14 +0900 Subject: [PATCH] =?UTF-8?q?=EB=8C=93=EA=B8=80=20=EB=8C=80=EB=8C=93?= =?UTF-8?q?=EA=B8=80=20=EC=88=98=EC=A0=95=20=EC=82=AD=EC=A0=9C=20=EC=99=84?= =?UTF-8?q?=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/board/BoardComment.vue | 14 +++- src/components/board/BoardCommentArea.vue | 2 +- src/components/board/BoardCommentList.vue | 35 ++++++++- src/components/board/BoardProfile.vue | 9 +-- src/views/board/BoardView.vue | 90 ++++++++++++++++------- 5 files changed, 113 insertions(+), 37 deletions(-) diff --git a/src/components/board/BoardComment.vue b/src/components/board/BoardComment.vue index 0dafc9a..c8d4245 100644 --- a/src/components/board/BoardComment.vue +++ b/src/components/board/BoardComment.vue @@ -11,7 +11,7 @@ :isLike="!isLike" :isCommentPassword="comment.isCommentPassword" :isCommentProfile="true" - @editClick="$emit('editClick', comment)" + @editClick="aaaa" @deleteClick="$emit('deleteClick', comment)" @updateReaction="handleUpdateReaction" /> @@ -56,11 +56,19 @@ :key="child.commentId" class="mt-8 pt-6 ps-10 border-top" > + + @@ -155,4 +163,8 @@ const submitEdit = () => { emit('submitEdit', props.comment, localEditedContent.value); }; +const aaaa = () => { + emit('editClick', props.comment); +} + diff --git a/src/components/board/BoardCommentArea.vue b/src/components/board/BoardCommentArea.vue index 30e9084..e25212e 100644 --- a/src/components/board/BoardCommentArea.vue +++ b/src/components/board/BoardCommentArea.vue @@ -79,7 +79,7 @@ const props = defineProps({ const comment = ref(''); const password = ref(''); -const isCheck = ref(props.unknown); +const isCheck = ref(''); const emit = defineEmits(['submitComment']); diff --git a/src/components/board/BoardCommentList.vue b/src/components/board/BoardCommentList.vue index 9813d9b..115fe5d 100644 --- a/src/components/board/BoardCommentList.vue +++ b/src/components/board/BoardCommentList.vue @@ -5,6 +5,8 @@ :key="comment.commentId" class="mt-6 border-bottom pb-6" > + + @@ -76,4 +78,29 @@ const handleUpdateReaction = (reactionData, commentId, boardId) => { const submitPassword = (comment, password) => { emit('submitPassword', comment, password); }; + +const handleEditClick = (comment) => { + emit('editClick', comment); +}; + +const handleSubmitEdit = (comment, editedContent) => { + emit("submitEdit", comment, editedContent); +}; + +const handleDeleteClick = (comment) => { + if (comment.parentId) { + emit('deleteClick', comment); // 대댓글 삭제 + } else { + emit('deleteClick', comment); // 댓글 삭제 + } +}; + +const handleCancelEdit = (comment) => { + if (comment.parentId) { + emit('cancelEdit', comment); // 대댓글 수정 취소 + } else { + emit('cancelEdit', comment); // 댓글 수정 취소 + } +}; + diff --git a/src/components/board/BoardProfile.vue b/src/components/board/BoardProfile.vue index 90c8db2..2c280f5 100644 --- a/src/components/board/BoardProfile.vue +++ b/src/components/board/BoardProfile.vue @@ -23,7 +23,7 @@
-