diff --git a/src/components/board/BoardComment.vue b/src/components/board/BoardComment.vue index 07e2327..dd6cfc0 100644 --- a/src/components/board/BoardComment.vue +++ b/src/components/board/BoardComment.vue @@ -14,16 +14,29 @@ @deleteClick="deleteClick" @submitPassword="submitPassword" @updateReaction="handleUpdateReaction" - @toggleEdit="emit('toggleEdit', comment.commentId, true)" + @toggleEdit="toggleEdit(true)" /> + +
+
+ + +
+ {{ passwordAlert }} +
diff --git a/src/components/board/BoardCommentArea.vue b/src/components/board/BoardCommentArea.vue index db85f1d..27ada9c 100644 --- a/src/components/board/BoardCommentArea.vue +++ b/src/components/board/BoardCommentArea.vue @@ -43,6 +43,7 @@ class="form-control flex-grow-1" v-model="password" /> +
@@ -74,20 +75,18 @@ const props = defineProps({ const comment = ref(''); const password = ref(''); -const isCheck = ref(false); +const isCheck = ref(props.unknown); const emit = defineEmits(['submitComment']); watch(() => props.unknown, (newVal) => { - if (!newVal) { - isCheck.value = false; - } + isCheck.value = newVal; }); function handleCommentSubmit() { emit('submitComment', { comment: comment.value, - password: password.value, + password: isCheck.value ? password.value : '', }); comment.value = ''; diff --git a/src/components/board/BoardCommentList.vue b/src/components/board/BoardCommentList.vue index f287e93..1141f6e 100644 --- a/src/components/board/BoardCommentList.vue +++ b/src/components/board/BoardCommentList.vue @@ -9,13 +9,14 @@ :unknown="unknown" :comment="comment" :isPassword="isPassword" + :isEditTextarea="isEditTextarea" @editClick="editClick" @deleteClick="deleteClick" @submitPassword="submitPassword" @submitComment="submitComment" - @updateReaction="(reactionData) => handleUpdateReaction(reactionData, comment.commentId)" + @commentDeleted="handleCommentDeleted" + @updateReaction="(reactionData) => handleUpdateReaction(reactionData, comment.commentId, comment.boardId)" /> - @@ -38,6 +39,10 @@ const props = defineProps({ type: Boolean, default: false, }, + isEditTextarea: { + type: Boolean, + default: false, + } }); const emit = defineEmits(['submitComment', 'updateReaction', 'editClick']); @@ -46,17 +51,13 @@ const submitComment = (replyData) => { emit('submitComment', replyData); }; -const handleUpdateReaction = (reactionData, commentId) => { - // console.log('📢 BoardCommentList에서 이벤트 수신:', reactionData); - // console.log('📌 전달할 댓글 ID>>>>:', commentId); - +const handleUpdateReaction = (reactionData, commentId, boardId) => { const updatedReactionData = { ...reactionData, - commentId: commentId + commentId: commentId || reactionData.commentId, + boardId: boardId || reactionData.boardId, }; - // console.log('🚀 최종 전달할 데이터:', updatedReactionData); - emit('updateReaction', updatedReactionData); } diff --git a/src/views/board/BoardList.vue b/src/views/board/BoardList.vue index 34740d2..523356f 100644 --- a/src/views/board/BoardList.vue +++ b/src/views/board/BoardList.vue @@ -1,102 +1,104 @@