diff --git a/src/components/board/BoardComment.vue b/src/components/board/BoardComment.vue
index 3ffa3b2..260316c 100644
--- a/src/components/board/BoardComment.vue
+++ b/src/components/board/BoardComment.vue
@@ -37,8 +37,9 @@
-
-
+
+
+
@@ -83,6 +84,7 @@ import { defineProps, defineEmits, ref, computed, watch } from 'vue';
import BoardProfile from './BoardProfile.vue';
import BoardCommentArea from './BoardCommentArea.vue';
import PlusButton from '../button/PlusBtn.vue';
+import SaveBtn from '../button/SaveBtn.vue';
const props = defineProps({
comment: {
diff --git a/src/components/board/BoardCommentList.vue b/src/components/board/BoardCommentList.vue
index 9813d9b..5304a99 100644
--- a/src/components/board/BoardCommentList.vue
+++ b/src/components/board/BoardCommentList.vue
@@ -12,13 +12,13 @@
:isCommentPassword="comment.isCommentPassword"
:isEditTextarea="comment.isEditTextarea"
:passwordCommentAlert="passwordCommentAlert"
- @editClick="$emit('editClick', comment)"
- @deleteClick="$emit('deleteClick', comment)"
+ @editClick="handleEditClick"
+ @deleteClick="handleDeleteClick"
@submitPassword="submitPassword"
@submitComment="submitComment"
@commentDeleted="handleCommentDeleted"
- @submitEdit="(comment, editedContent) => $emit('submitEdit', comment, editedContent)"
- @cancelEdit="$emit('cancelEdit', comment)"
+ @submitEdit="handleSubmitEdit"
+ @cancelEdit="handleCancelEdit"
@updateReaction="(reactionData) => handleUpdateReaction(reactionData, comment.commentId, comment.boardId)"
/>
@@ -76,4 +76,28 @@ const handleUpdateReaction = (reactionData, commentId, boardId) => {
const submitPassword = (comment, password) => {
emit('submitPassword', comment, password);
};
+
+const handleEditClick = (comment) => {
+ emit('editClick', comment);
+};
+
+const handleSubmitEdit = (comment, editedContent) => {
+ emit("submitEdit", comment, editedContent);
+};
+
+const handleDeleteClick = (comment) => {
+ if (comment.parentId) {
+ emit('deleteClick', comment); // 대댓글 삭제
+ } else {
+ emit('deleteClick', comment); // 댓글 삭제
+ }
+};
+
+const handleCancelEdit = (comment) => {
+ if (comment.parentId) {
+ emit('cancelEdit', comment); // 대댓글 수정 취소
+ } else {
+ emit('cancelEdit', comment); // 댓글 수정 취소
+ }
+};