$emit('submitEdit', comment, editedContent)"
@@ -111,6 +112,9 @@ const props = defineProps({
passwordCommentAlert: {
type: String,
default: ''
+ },
+ currentPasswordCommentId: {
+ type: Number
}
});
diff --git a/src/components/board/BoardCommentList.vue b/src/components/board/BoardCommentList.vue
index 8ac413b..928c281 100644
--- a/src/components/board/BoardCommentList.vue
+++ b/src/components/board/BoardCommentList.vue
@@ -12,6 +12,7 @@
:isEditTextarea="comment.isEditTextarea"
:isCommentPassword="isCommentPassword"
:passwordCommentAlert="passwordCommentAlert || ''"
+ :currentPasswordCommentId="currentPasswordCommentId"
@editClick="handleEditClick"
@deleteClick="handleDeleteClick"
@submitPassword="submitPassword"
@@ -53,6 +54,9 @@ const props = defineProps({
passwordCommentAlert: {
type: String,
default: ''
+ },
+ currentPasswordCommentId: {
+ type: Number
}
});
diff --git a/src/views/board/BoardView.vue b/src/views/board/BoardView.vue
index 358c192..63329d5 100644
--- a/src/views/board/BoardView.vue
+++ b/src/views/board/BoardView.vue
@@ -102,6 +102,7 @@
:isCommentPassword="isCommentPassword"
:isEditTextarea="isEditTextarea"
:passwordCommentAlert="passwordCommentAlert"
+ :currentPasswordCommentId="currentPasswordCommentId"
@editClick="editComment"
@deleteClick="deleteComment"
@updateReaction="handleCommentReaction"
@@ -489,10 +490,10 @@ const deleteComment = async (comment) => {
// 익명 비밀번호 창 토글
const toggleCommentPassword = (comment, button) => {
console.log(comment.commentId)
- if (lastCommentClickedButton.value === button && isCommentPassword.value === comment.commentId) {
- isCommentPassword.value = false; // 비밀번호 창 닫기
+ if (lastCommentClickedButton.value === button && currentPasswordCommentId.value === comment.commentId) {
+ currentPasswordCommentId.value = null; // 비밀번호 창 닫기
} else {
- isCommentPassword.value = comment.commentId; // 비밀번호 창 열기
+ currentPasswordCommentId.value = comment.commentId; // 비밀번호 창 열기
}
lastCommentClickedButton.value = button;