경고 수정중
This commit is contained in:
parent
2cc280717d
commit
63f8f167eb
@ -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>
|
||||||
|
|||||||
@ -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: ''
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -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); // 댓글
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -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,
|
||||||
|
|||||||
@ -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: {
|
||||||
|
|||||||
@ -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,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user