사용자의 게시글 좋아요 싫어요 상태 업데이트
This commit is contained in:
parent
e447968ecf
commit
3f8718831f
@ -1,8 +1,16 @@
|
|||||||
<template v-if="isRecommend">
|
<template v-if="isRecommend">
|
||||||
<button class="btn btn-label-primary btn-icon me-1" :class="{ clicked: likeClicked, big: bigBtn }" @click="handleLike">
|
<button
|
||||||
|
class="btn btn-label-primary btn-icon me-1"
|
||||||
|
:class="{ clicked: likeClicked, big: bigBtn, active: likeClicked }"
|
||||||
|
@click="handleLike"
|
||||||
|
>
|
||||||
<i class="fa-regular fa-thumbs-up"></i> <span class="ms-1">{{ likeCount }}</span>
|
<i class="fa-regular fa-thumbs-up"></i> <span class="ms-1">{{ likeCount }}</span>
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-label-danger btn-icon" :class="{ clicked: dislikeClicked, big: bigBtn }" @click="handleDislike">
|
<button
|
||||||
|
class="btn btn-label-danger btn-icon"
|
||||||
|
:class="{ clicked: dislikeClicked, big: bigBtn, active: dislikeClicked }"
|
||||||
|
@click="handleDislike"
|
||||||
|
>
|
||||||
<i class="fa-regular fa-thumbs-down"></i> <span class="ms-1">{{ dislikeCount }}</span>
|
<i class="fa-regular fa-thumbs-down"></i> <span class="ms-1">{{ dislikeCount }}</span>
|
||||||
</button>
|
</button>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@ -78,8 +78,7 @@
|
|||||||
style="line-height: 1.6"
|
style="line-height: 1.6"
|
||||||
v-html="$common.contentToHtml(boardContent)"
|
v-html="$common.contentToHtml(boardContent)"
|
||||||
></div>
|
></div>
|
||||||
<div v-if="!unknown" class= "my-12 py-12 pt-12">
|
<div v-if="!unknown" class="my-12 py-12 pt-12"></div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 좋아요 버튼 -->
|
<!-- 좋아요 버튼 -->
|
||||||
<div v-if="unknown" class="row justify-content-center my-10">
|
<div v-if="unknown" class="row justify-content-center my-10">
|
||||||
@ -274,6 +273,14 @@
|
|||||||
attachment.value = boardData.hasAttachment || null;
|
attachment.value = boardData.hasAttachment || null;
|
||||||
commentNum.value = boardData.commentCount || 0;
|
commentNum.value = boardData.commentCount || 0;
|
||||||
attachments.value = boardData.attachments || [];
|
attachments.value = boardData.attachments || [];
|
||||||
|
|
||||||
|
if (boardData?.myReaction == 1) {
|
||||||
|
likeClicked.value = true;
|
||||||
|
dislikeClicked.value = false;
|
||||||
|
} else if (boardData?.myReaction == 2) {
|
||||||
|
likeClicked.value = false;
|
||||||
|
dislikeClicked.value = true;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
toastStore.onToast(data.message, 'e');
|
toastStore.onToast(data.message, 'e');
|
||||||
router.back();
|
router.back();
|
||||||
|
|||||||
@ -273,7 +273,6 @@
|
|||||||
if (attachFiles.value && attachFiles.value.length > 0) {
|
if (attachFiles.value && attachFiles.value.length > 0) {
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
attachFiles.value.map(async file => {
|
attachFiles.value.map(async file => {
|
||||||
console.log(file);
|
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
const fileNameWithoutExt = file.name.replace(/\.[^/.]+$/, '');
|
const fileNameWithoutExt = file.name.replace(/\.[^/.]+$/, '');
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user