댓글 사용자 좋아요 싫어요 상태 업데이트
This commit is contained in:
parent
3f8718831f
commit
ad4bcb511f
@ -33,13 +33,20 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<!-- 좋아요, 싫어요 버튼 (댓글에서만 표시) -->
|
<!-- 좋아요, 싫어요 버튼 (댓글에서만 표시) -->
|
||||||
<BoardRecommendBtn v-if="isLike && !isDeletedComment" :boardId="boardId" :comment="comment" @updateReaction="handleUpdateReaction" />
|
<BoardRecommendBtn
|
||||||
|
v-if="isLike && !isDeletedComment"
|
||||||
|
:boardId="boardId"
|
||||||
|
:comment="comment"
|
||||||
|
:likeClicked="comment.likeClicked"
|
||||||
|
:dislikeClicked="comment.dislikeClicked"
|
||||||
|
@updateReaction="handleUpdateReaction"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, defineProps, defineEmits, inject } from 'vue';
|
import { computed, defineProps, defineEmits, inject, onMounted } from 'vue';
|
||||||
import DeleteButton from '../button/DeleteBtn.vue';
|
import DeleteButton from '../button/DeleteBtn.vue';
|
||||||
import EditButton from '../button/EditBtn.vue';
|
import EditButton from '../button/EditBtn.vue';
|
||||||
import BoardRecommendBtn from '../button/BoardRecommendBtn.vue';
|
import BoardRecommendBtn from '../button/BoardRecommendBtn.vue';
|
||||||
|
|||||||
@ -341,8 +341,6 @@
|
|||||||
dislikeCount: comment.dislikeCount || 0,
|
dislikeCount: comment.dislikeCount || 0,
|
||||||
profileImg: comment.profileImg || '',
|
profileImg: comment.profileImg || '',
|
||||||
nickname: comment.LOCCMTNIC || '',
|
nickname: comment.LOCCMTNIC || '',
|
||||||
likeClicked: comment.likeClicked || false,
|
|
||||||
dislikeClicked: comment.dislikeClicked || false,
|
|
||||||
createdAtRaw: comment.LOCCMTRDT, // 작성일
|
createdAtRaw: comment.LOCCMTRDT, // 작성일
|
||||||
// createdAt: formattedDate(comment.LOCCMTRDT), // 작성일(노출용)
|
// createdAt: formattedDate(comment.LOCCMTRDT), // 작성일(노출용)
|
||||||
// createdAtRaw: new Date(comment.LOCCMTUDT), // 수정순
|
// createdAtRaw: new Date(comment.LOCCMTUDT), // 수정순
|
||||||
@ -351,6 +349,8 @@
|
|||||||
(comment.content === '삭제된 댓글입니다' && comment.LOCCMTUDT !== comment.LOCCMTRDT ? ' (수정됨)' : ''), // 수정일(노출용)
|
(comment.content === '삭제된 댓글입니다' && comment.LOCCMTUDT !== comment.LOCCMTRDT ? ' (수정됨)' : ''), // 수정일(노출용)
|
||||||
children: [], // 대댓글을 담을 배열
|
children: [], // 대댓글을 담을 배열
|
||||||
updateAtRaw: comment.LOCCMTUDT,
|
updateAtRaw: comment.LOCCMTUDT,
|
||||||
|
likeClicked: comment.myReaction == 1,
|
||||||
|
dislikeClicked: comment.myReaction == 2,
|
||||||
}))
|
}))
|
||||||
.sort((a, b) => b.createdAtRaw - a.createdAtRaw);
|
.sort((a, b) => b.createdAtRaw - a.createdAtRaw);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user