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