.
This commit is contained in:
parent
77f248cead
commit
4cf31aee12
@ -42,11 +42,7 @@
|
|||||||
<p class="m-0">{{ comment.content }}</p>
|
<p class="m-0">{{ comment.content }}</p>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<!-- <p>현재 isDeleted 값: {{ isDeleted }}</p> -->
|
|
||||||
|
|
||||||
<!-- <template v-if="isDeleted">
|
|
||||||
<p class="m-0 text-muted">댓글이 삭제되었습니다.</p>
|
|
||||||
</template> -->
|
|
||||||
<PlusButton v-if="isPlusButton" @click="toggleComment" class="mt-6"/>
|
<PlusButton v-if="isPlusButton" @click="toggleComment" class="mt-6"/>
|
||||||
<BoardCommentArea v-if="isComment" :unknown="unknown" @submitComment="submitComment"/>
|
<BoardCommentArea v-if="isComment" :unknown="unknown" @submitComment="submitComment"/>
|
||||||
|
|
||||||
@ -114,10 +110,6 @@ const props = defineProps({
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
isDeleted: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
isCommentPassword: {
|
isCommentPassword: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
@ -172,15 +164,6 @@ watch(() => props.comment.isEditTextarea, (newVal) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// watch(() => props.comment.isDeleted, () => {
|
|
||||||
// console.log("BoardComment - isDeleted 상태 변경됨:", newVal);
|
|
||||||
|
|
||||||
// if (newVal) {
|
|
||||||
// localEditedContent.value = "댓글이 삭제되었습니다."; // UI 반영
|
|
||||||
// props.comment.isEditTextarea = false;
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
// 수정버튼
|
// 수정버튼
|
||||||
const submitEdit = () => {
|
const submitEdit = () => {
|
||||||
emit('submitEdit', props.comment, localEditedContent.value);
|
emit('submitEdit', props.comment, localEditedContent.value);
|
||||||
|
|||||||
@ -10,7 +10,6 @@
|
|||||||
:comment="comment"
|
:comment="comment"
|
||||||
:isCommentAuthor="comment.isCommentAuthor"
|
:isCommentAuthor="comment.isCommentAuthor"
|
||||||
:isEditTextarea="comment.isEditTextarea"
|
:isEditTextarea="comment.isEditTextarea"
|
||||||
:isDeleted="isDeleted"
|
|
||||||
:isCommentPassword="isCommentPassword"
|
:isCommentPassword="isCommentPassword"
|
||||||
:passwordCommentAlert="passwordCommentAlert || ''"
|
:passwordCommentAlert="passwordCommentAlert || ''"
|
||||||
:currentPasswordCommentId="currentPasswordCommentId"
|
:currentPasswordCommentId="currentPasswordCommentId"
|
||||||
@ -54,10 +53,6 @@ const props = defineProps({
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
isDeleted: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
passwordCommentAlert: {
|
passwordCommentAlert: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
|
|||||||
@ -102,7 +102,6 @@
|
|||||||
:comments="commentsWithAuthStatus"
|
:comments="commentsWithAuthStatus"
|
||||||
:isCommentPassword="isCommentPassword"
|
:isCommentPassword="isCommentPassword"
|
||||||
:isEditTextarea="isEditTextarea"
|
:isEditTextarea="isEditTextarea"
|
||||||
:isDeleted="isDeleted"
|
|
||||||
:passwordCommentAlert="passwordCommentAlert"
|
:passwordCommentAlert="passwordCommentAlert"
|
||||||
:currentPasswordCommentId="currentPasswordCommentId"
|
:currentPasswordCommentId="currentPasswordCommentId"
|
||||||
:password="password"
|
:password="password"
|
||||||
@ -184,7 +183,6 @@ const currentPasswordCommentId = ref(null);
|
|||||||
const lastClickedButton = ref("");
|
const lastClickedButton = ref("");
|
||||||
const lastCommentClickedButton = ref("");
|
const lastCommentClickedButton = ref("");
|
||||||
const isEditTextarea = ref(false);
|
const isEditTextarea = ref(false);
|
||||||
const isDeleted = ref(true);
|
|
||||||
const commentAlert = ref('');
|
const commentAlert = ref('');
|
||||||
|
|
||||||
const updatePassword = (newPassword) => {
|
const updatePassword = (newPassword) => {
|
||||||
@ -686,14 +684,6 @@ const deleteReplyComment = async (comment) => {
|
|||||||
|
|
||||||
if (response.data.code === 200) {
|
if (response.data.code === 200) {
|
||||||
await fetchComments();
|
await fetchComments();
|
||||||
|
|
||||||
if (targetComment) {
|
|
||||||
// console.log('타겟',targetComment)
|
|
||||||
// ✅ 댓글 내용만 "삭제된 댓글입니다."로 변경하고, 구조는 유지
|
|
||||||
targetComment.content = "댓글이 삭제되었습니다.";
|
|
||||||
targetComment.author = "알 수 없음"; // 익명 처리
|
|
||||||
targetComment.isDeleted = true; // ✅ 삭제 상태를 추가
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
alert("댓글 삭제에 실패했습니다.");
|
alert("댓글 삭제에 실패했습니다.");
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user