댓글 비밀번호 진행중
This commit is contained in:
parent
62361b7ae9
commit
3f4743cac2
@ -31,7 +31,7 @@
|
||||
|
||||
<div class="mt-6">
|
||||
<template v-if="comment.isEditTextarea">
|
||||
<textarea v-model="editedContent" class="form-control"></textarea>
|
||||
<textarea v-model="localEditedContent" class="form-control"></textarea>
|
||||
<div class="mt-2 d-flex justify-content-end">
|
||||
<button class="btn btn-secondary me-2" @click="$emit('cancelEdit', comment)">취소</button>
|
||||
<button class="btn btn-primary" @click="$emit('submitEdit', comment, editedContent)">수정</button>
|
||||
@ -110,7 +110,7 @@ const props = defineProps({
|
||||
const emit = defineEmits(['submitComment', 'updateReaction', 'editClick', 'deleteClick', 'submitPassword', 'submitEdit', 'cancelEdit']);
|
||||
|
||||
const password = ref('');
|
||||
|
||||
const localEditedContent = ref(props.editedContent);
|
||||
|
||||
// 댓글 입력 창 토글
|
||||
const isComment = ref(false);
|
||||
@ -142,16 +142,20 @@ const logPasswordAndEmit = () => {
|
||||
emit('submitPassword', props.comment, password.value);
|
||||
};
|
||||
|
||||
|
||||
watch(() => props.editedContent, (newValue) => {
|
||||
localEditedContent.value = newValue;
|
||||
});
|
||||
// 댓글 수정 취소
|
||||
// const cancelEdit = () => {
|
||||
// isEditTextarea.value = false;
|
||||
// };
|
||||
|
||||
// 댓글 수정 내용 저장
|
||||
// const submitEdit = () => {
|
||||
// emit('submitComment', { commentId: props.comment.commentId, content: editedContent.value });
|
||||
// isEditTextarea.value = false; // 수정 모드 종료
|
||||
// };
|
||||
const submitEdit = () => {
|
||||
emit('submitComment', { commentId: props.comment.commentId, content: editedContent.value });
|
||||
isEditTextarea.value = false; // 수정 모드 종료
|
||||
};
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
@ -543,8 +543,8 @@ const submitCommentPassword = async (comment, password) => {
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('코멘트아이디:', comment.commentId, '비번:', password)
|
||||
comment.isEditTextarea = true;
|
||||
// console.log('코멘트아이디:', comment.commentId, '비번:', password)
|
||||
// comment.isEditTextarea = true;
|
||||
|
||||
//비밀번호 확인 안됨
|
||||
try {
|
||||
@ -553,15 +553,15 @@ const submitCommentPassword = async (comment, password) => {
|
||||
LOCCMTSEQ: comment.commentId,
|
||||
});
|
||||
|
||||
console.log("응답!!!!!!!!", response); // 서버 응답 전체 확인
|
||||
console.log("응답 데이터:", response.data);
|
||||
// console.log("응답!!!!!!!!", response); // 서버 응답 전체 확인
|
||||
// console.log("응답 데이터:", response.data);
|
||||
|
||||
if (response.data.code === 200 && response.data.data === true) {
|
||||
console.log('되는거니')
|
||||
// deleteComment()
|
||||
// // password.value = '';
|
||||
// // isPassword.value = false;
|
||||
// // isEditTextarea.value = true;
|
||||
password.value = '';
|
||||
isPassword.value = false;
|
||||
comment.isEditTextarea.value = true;
|
||||
} else {
|
||||
passwordAlert.value = "비밀번호가 일치하지 않습니다.";
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user