경고 수정중

This commit is contained in:
kimdaae328 2025-02-28 10:57:25 +09:00
parent 2cc280717d
commit 63f8f167eb
6 changed files with 16 additions and 16 deletions

View File

@ -59,7 +59,7 @@
:isCommentProfile="true" :isCommentProfile="true"
:isCommentAuthor="child.isCommentAuthor" :isCommentAuthor="child.isCommentAuthor"
:isCommentPassword="isCommentPassword" :isCommentPassword="isCommentPassword"
@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)"
@cancelEdit="$emit('cancelEdit', child)" @cancelEdit="$emit('cancelEdit', child)"
@ -110,7 +110,7 @@ const props = defineProps({
}, },
passwordCommentAlert: { passwordCommentAlert: {
type: String, type: String,
default: false default: ''
} }
}); });
@ -164,8 +164,8 @@ const handleEditClick = () => {
emit('editClick', props.comment); emit('editClick', props.comment);
} }
const handleReplyEditClick = (event) => { const handleReplyEditClick = (comment) => {
emit('editClick', event); emit('editClick', comment);
} }
</script> </script>

View File

@ -73,11 +73,11 @@ const props = defineProps({
}, },
passwordAlert: { passwordAlert: {
type: String, type: String,
default: false default: ''
}, },
commentAlert: { commentAlert: {
type: String, type: String,
default: false default: ''
} }
}); });

View File

@ -11,12 +11,11 @@
:isCommentAuthor="comment.isCommentAuthor" :isCommentAuthor="comment.isCommentAuthor"
:isEditTextarea="comment.isEditTextarea" :isEditTextarea="comment.isEditTextarea"
:isCommentPassword="isCommentPassword" :isCommentPassword="isCommentPassword"
:passwordCommentAlert="passwordCommentAlert" :passwordCommentAlert="passwordCommentAlert || ''"
@editClick="handleEditClick" @editClick="handleEditClick"
@deleteClick="handleDeleteClick" @deleteClick="handleDeleteClick"
@submitPassword="submitPassword" @submitPassword="submitPassword"
@submitComment="submitComment" @submitComment="submitComment"
@commentDeleted="handleCommentDeleted"
@submitEdit="handleSubmitEdit" @submitEdit="handleSubmitEdit"
@cancelEdit="handleCancelEdit" @cancelEdit="handleCancelEdit"
@updateReaction="(reactionData) => handleUpdateReaction(reactionData, comment.commentId, comment.boardId)" @updateReaction="(reactionData) => handleUpdateReaction(reactionData, comment.commentId, comment.boardId)"
@ -53,11 +52,11 @@ const props = defineProps({
}, },
passwordCommentAlert: { passwordCommentAlert: {
type: String, type: String,
default: false default: ''
} }
}); });
const emit = defineEmits(['submitComment', 'updateReaction', 'editClick', 'deleteClick', 'submitPassword', 'clearPassword']); const emit = defineEmits(['submitComment', 'updateReaction', 'editClick', 'deleteClick', 'submitPassword', 'clearPassword','submitEdit']);
const submitComment = (replyData) => { const submitComment = (replyData) => {
emit('submitComment', replyData); emit('submitComment', replyData);
@ -79,9 +78,9 @@ const submitPassword = (comment, password) => {
const handleEditClick = (comment) => { const handleEditClick = (comment) => {
if (comment.parentId) { if (comment.parentId) {
emit('deleteClick', comment); // emit('editClick', comment); //
} else { } else {
emit('deleteClick', comment); // emit('editClick', comment); //
} }
}; };

View File

@ -82,7 +82,7 @@ const props = defineProps({
isCommentProfile: Boolean, // isCommentProfile: Boolean, //
date: { date: {
type: String, type: String,
required: true, required: '',
}, },
views: { views: {
type: Number, type: Number,

View File

@ -13,7 +13,7 @@ import { ref, computed } from 'vue';
const props = defineProps({ const props = defineProps({
comment: { comment: {
type: Object, type: Object,
required: true, default: () => ({}),
}, },
likeClicked : { likeClicked : {
type : Boolean, type : Boolean,
@ -36,7 +36,7 @@ const props = defineProps({
required: true, required: true,
}, },
commentId: { commentId: {
type: Number, type: [Number, null],
default: null, default: null,
}, },
likeCount: { likeCount: {

View File

@ -175,6 +175,7 @@ const passwordAlert = ref("");
const passwordCommentAlert = ref(""); const passwordCommentAlert = ref("");
const isPassword = ref(false); const isPassword = ref(false);
const isCommentPassword = ref(false); const isCommentPassword = ref(false);
const currentPasswordCommentId = ref(null);
const lastClickedButton = ref(""); const lastClickedButton = ref("");
const lastCommentClickedButton = ref(""); const lastCommentClickedButton = ref("");
const isEditTextarea = ref(false); const isEditTextarea = ref(false);
@ -487,6 +488,7 @@ const deleteComment = async (comment) => {
// //
const toggleCommentPassword = (comment, button) => { const toggleCommentPassword = (comment, button) => {
console.log(comment.commentId)
if (lastCommentClickedButton.value === button && isCommentPassword.value === comment.commentId) { if (lastCommentClickedButton.value === button && isCommentPassword.value === comment.commentId) {
isCommentPassword.value = false; // isCommentPassword.value = false; //
} else { } else {
@ -637,7 +639,6 @@ const deleteReplyComment = async (comment) => {
// //
const handleSubmitEdit = async (comment, editedContent) => { const handleSubmitEdit = async (comment, editedContent) => {
console.log('asdasdasdasd')
try { try {
const response = await axios.put(`board/comment/${comment.commentId}`, { const response = await axios.put(`board/comment/${comment.commentId}`, {
LOCCMTSEQ: comment.commentId, LOCCMTSEQ: comment.commentId,