좋아요 싫어요 버튼 수정

This commit is contained in:
kimdaae328 2025-02-01 14:54:15 +09:00
parent 0f78a0f8ac
commit c68043f12b
4 changed files with 26 additions and 10 deletions

View File

@ -1,10 +1,10 @@
<template> <template>
<div> <div>
<BoardProfile :profileName="comment.author" :showDetail="false" :author="true" /> <BoardProfile :profileName="comment.author" :showDetail="false" :author="true" />
<div class="my-6"> <div class="mt-6">
<p>{{ comment.content }}</p> <p class="m-0">{{ comment.content }}</p>
</div> </div>
<PlusButton v-if="isPlusButton" @click="toggleComment"/> <PlusButton v-if="isPlusButton" @click="toggleComment" class="mt-6"/>
<BoardComentArea v-if="isComment" @submit="submitComment"/> <BoardComentArea v-if="isComment" @submit="submitComment"/>
<!-- 대댓글 --> <!-- 대댓글 -->
@ -12,7 +12,7 @@
<li <li
v-for="child in comment.children" v-for="child in comment.children"
:key="child.id" :key="child.id"
class="pt-6 ps-10" class="pt-8 ps-10"
> >
<BoardComment :comment="child" :isPlusButton="false" @submitComment="addChildComment" /> <BoardComment :comment="child" :isPlusButton="false" @submitComment="addChildComment" />
</li> </li>

View File

@ -3,7 +3,7 @@
<li <li
v-for="comment in comments" v-for="comment in comments"
:key="comment.id" :key="comment.id"
class="mt-6" class="mt-8"
> >
<BoardComment :comment="comment" @submitComment="addComment" /> <BoardComment :comment="comment" @submitComment="addComment" />
</li> </li>

View File

@ -10,13 +10,13 @@
<span>2024.12.10 10:46</span> <span>2024.12.10 10:46</span>
<template v-if="showDetail"> <template v-if="showDetail">
<span> <span>
<i class="fa-regular fa-eye"></i> 1 <i class="fa-regular fa-eye"></i> {{ views }}
</span> </span>
<span> <span>
<i class="fa-regular fa-thumbs-up"></i> 1 <i class="fa-regular fa-thumbs-up"></i> {{ likes }}
</span> </span>
<span> <span>
<i class="fa-regular fa-thumbs-down"></i> 1 <i class="fa-regular fa-thumbs-down"></i> {{ dislikes }}
</span> </span>
</template> </template>
</div> </div>
@ -55,7 +55,7 @@ import BoardRecommendBtn from '../button/BoardRecommendBtn.vue';
const router = useRouter(); const router = useRouter();
// Props // Props
defineProps({ const props = defineProps({
profileName: { profileName: {
type: String, type: String,
default: '익명', default: '익명',
@ -72,6 +72,18 @@ defineProps({
type: Boolean, type: Boolean,
default: false, default: false,
}, },
views: {
type: Number,
default: 0,
},
likes: {
type: Number,
default: null,
},
dislikes: {
type: Number,
default: null,
},
}); });
const boardId = 100; //!! const boardId = 100; //!!

View File

@ -5,7 +5,11 @@
<div class="card"> <div class="card">
<!-- 프로필 헤더 --> <!-- 프로필 헤더 -->
<div class="card-header"> <div class="card-header">
<BoardProfile :boardId="currentBoardId" :profileName="profileName" class="pb-6 border-bottom" /> <BoardProfile
:boardId="currentBoardId"
:profileName="profileName"
class="pb-6 border-bottom"
/>
</div> </div>
<!-- 게시글 내용 --> <!-- 게시글 내용 -->
<div class="card-body"> <div class="card-body">