diff --git a/src/components/board/BoardComment.vue b/src/components/board/BoardComment.vue
index 200704f..940c6bc 100644
--- a/src/components/board/BoardComment.vue
+++ b/src/components/board/BoardComment.vue
@@ -12,6 +12,8 @@
:isLike="!isLike"
:isCommentPassword="isCommentPassword"
:isCommentProfile="true"
+ :is-edit-pushed="isEditPushed"
+ :is-delete-pushed="isDeletePushed"
@editClick="handleEditClick"
@deleteClick="$emit('deleteClick', comment)"
@updateReaction="handleUpdateReaction"
@@ -116,9 +118,20 @@
password: {
type: String,
},
+ // isEditPushed: {
+ // type: Boolean,
+ // required: false,
+ // },
+ // isDeletePushed: {
+ // type: Boolean,
+ // required: false,
+ // },
editCommentAlert: String,
});
+ const isEditPushed = ref(false);
+ const isDeletePushed = ref(false);
+
const displayName = computed(() => {
return props.nickname ? props.nickname : props.comment.author;
});
@@ -171,6 +184,24 @@
emit('submitPassword', props.comment, props.password);
};
+ const handleInject = inject('isBtnPushed');
+
+ // 수정, 삭제 버튼 활성화 상태값
+ watch(
+ () => handleInject.value,
+ (newValue, oldValue) => {
+ if (newValue) {
+ if (newValue.target == props.comment.commentId) {
+ isEditPushed.value = newValue.isEditPushed;
+ isDeletePushed.value = newValue.isDeletePushed;
+ } else {
+ isEditPushed.value = false;
+ isDeletePushed.value = false;
+ }
+ }
+ },
+ );
+
watch(
() => props.comment.isEditTextarea,
newVal => {
diff --git a/src/components/board/BoardCommentList.vue b/src/components/board/BoardCommentList.vue
index 49ec969..0181b80 100644
--- a/src/components/board/BoardCommentList.vue
+++ b/src/components/board/BoardCommentList.vue
@@ -13,6 +13,8 @@
:currentPasswordCommentId="currentPasswordCommentId"
:password="password"
:editCommentAlert="editCommentAlert[comment.commentId]"
+ :is-edit-pushed="comment.isEditPushed"
+ :is-delete-pushed="comment.isDeletePushed"
@editClick="handleEditClick"
@deleteClick="handleDeleteClick"
@submitPassword="submitPassword"
@@ -40,6 +42,8 @@
:passwordCommentAlert="passwordCommentAlert"
:password="password"
:editCommentAlert="editCommentAlert[child.commentId]"
+ :is-edit-pushed="child.isEditPushed"
+ :is-delete-pushed="child.isDeletePushed"
@editClick="handleReplyEditClick"
@deleteClick="$emit('deleteClick', child)"
@submitEdit="(comment, editedContent) => $emit('submitEdit', comment, editedContent, child.commentId)"
@@ -59,7 +63,7 @@
diff --git a/src/components/button/EditBtn.vue b/src/components/button/EditBtn.vue
index 5058a97..c340e88 100644
--- a/src/components/button/EditBtn.vue
+++ b/src/components/button/EditBtn.vue
@@ -1,10 +1,10 @@
-