warning수정

This commit is contained in:
kimdaae328 2025-02-28 11:09:10 +09:00
parent 63f8f167eb
commit 4720e61958
3 changed files with 13 additions and 4 deletions

View File

@ -16,7 +16,7 @@
@updateReaction="handleUpdateReaction" @updateReaction="handleUpdateReaction"
/> />
<!-- 댓글 비밀번호 입력창 (익명일 경우) --> <!-- 댓글 비밀번호 입력창 (익명일 경우) -->
<div v-if="isCommentPassword === comment.commentId && unknown" class="mt-3 w-25 ms-auto"> <div v-if="currentPasswordCommentId === comment.commentId && unknown" class="mt-3 w-25 ms-auto">
<div class="input-group"> <div class="input-group">
<input <input
type="password" type="password"
@ -59,6 +59,7 @@
:isCommentProfile="true" :isCommentProfile="true"
:isCommentAuthor="child.isCommentAuthor" :isCommentAuthor="child.isCommentAuthor"
:isCommentPassword="isCommentPassword" :isCommentPassword="isCommentPassword"
:currentPasswordCommentId="currentPasswordCommentId"
@editClick="handleReplyEditClick" @editClick="handleReplyEditClick"
@deleteClick="$emit('deleteClick', child)" @deleteClick="$emit('deleteClick', child)"
@submitEdit="(comment, editedContent) => $emit('submitEdit', comment, editedContent)" @submitEdit="(comment, editedContent) => $emit('submitEdit', comment, editedContent)"
@ -111,6 +112,9 @@ const props = defineProps({
passwordCommentAlert: { passwordCommentAlert: {
type: String, type: String,
default: '' default: ''
},
currentPasswordCommentId: {
type: Number
} }
}); });

View File

@ -12,6 +12,7 @@
:isEditTextarea="comment.isEditTextarea" :isEditTextarea="comment.isEditTextarea"
:isCommentPassword="isCommentPassword" :isCommentPassword="isCommentPassword"
:passwordCommentAlert="passwordCommentAlert || ''" :passwordCommentAlert="passwordCommentAlert || ''"
:currentPasswordCommentId="currentPasswordCommentId"
@editClick="handleEditClick" @editClick="handleEditClick"
@deleteClick="handleDeleteClick" @deleteClick="handleDeleteClick"
@submitPassword="submitPassword" @submitPassword="submitPassword"
@ -53,6 +54,9 @@ const props = defineProps({
passwordCommentAlert: { passwordCommentAlert: {
type: String, type: String,
default: '' default: ''
},
currentPasswordCommentId: {
type: Number
} }
}); });

View File

@ -102,6 +102,7 @@
:isCommentPassword="isCommentPassword" :isCommentPassword="isCommentPassword"
:isEditTextarea="isEditTextarea" :isEditTextarea="isEditTextarea"
:passwordCommentAlert="passwordCommentAlert" :passwordCommentAlert="passwordCommentAlert"
:currentPasswordCommentId="currentPasswordCommentId"
@editClick="editComment" @editClick="editComment"
@deleteClick="deleteComment" @deleteClick="deleteComment"
@updateReaction="handleCommentReaction" @updateReaction="handleCommentReaction"
@ -489,10 +490,10 @@ const deleteComment = async (comment) => {
// //
const toggleCommentPassword = (comment, button) => { const toggleCommentPassword = (comment, button) => {
console.log(comment.commentId) console.log(comment.commentId)
if (lastCommentClickedButton.value === button && isCommentPassword.value === comment.commentId) { if (lastCommentClickedButton.value === button && currentPasswordCommentId.value === comment.commentId) {
isCommentPassword.value = false; // currentPasswordCommentId.value = null; //
} else { } else {
isCommentPassword.value = comment.commentId; // currentPasswordCommentId.value = comment.commentId; //
} }
lastCommentClickedButton.value = button; lastCommentClickedButton.value = button;