날짜 변환전, 좋아요 해결완료

This commit is contained in:
kimdaae328 2025-02-04 10:57:18 +09:00
parent 8e42b6b2b5
commit d1aa5fb438
2 changed files with 21 additions and 23 deletions

View File

@ -7,16 +7,13 @@
<div class="me-2">
<h6 class="mb-0">{{ profileName }}</h6>
<div class="profile-detail">
<span>2024.12.10 10:46</span>
<span>{{ date }}</span>
<template v-if="showDetail">
<span>
<i class="fa-regular fa-eye"></i> {{ views }}
</span>
<span>
<i class="fa-regular fa-thumbs-up"></i> {{ likes }}
</span>
<span>
<i class="fa-regular fa-thumbs-down"></i> {{ dislikes }}
<i class="bx bx-comment"></i> {{ comments }}
</span>
</template>
</div>
@ -72,17 +69,17 @@ const props = defineProps({
type: Boolean,
default: false,
},
date: {
type: String,
required: true,
},
views: {
type: Number,
default: 0,
},
likes: {
comments: {
type: Number,
default: null,
},
dislikes: {
type: Number,
default: null,
default: 0,
},
isChild: {
type: Boolean,

View File

@ -9,8 +9,8 @@
:boardId="currentBoardId"
:profileName="profileName"
:views="views"
:likes="likes"
:dislikes="dislikes"
:comments="comments"
:date="date"
class="pb-6 border-bottom"
/>
</div>
@ -49,8 +49,8 @@
:bigBtn="true"
:boardId="currentBoardId"
:commentId="null"
:likeCount="currentLikeCount"
:dislikeCount="currentDislikeCount"
:likeCount="likes"
:dislikeCount="dislikes"
@updateReaction="handleUpdateReaction"
/>
</div>
@ -63,7 +63,7 @@
</ul> -->
<!-- 댓글 영역 -->
<BoardComentArea :comments="comments" />
<BoardComentArea />
<!-- 수정 버튼 -->
<!-- <button class="btn btn-primary" @click="goToEditPage">
@ -95,11 +95,12 @@ import axios from '@api';
const profileName = ref('익명 사용자');
const boardTitle = ref('제목 없음');
const boardContent = ref('');
const comments = ref([]);
const attachments = ref([]);
const date = ref('');
const views = ref(0);
const likes = ref(0);
const dislikes = ref(0);
const comments = ref(0);
const attachment = ref(false);
// ID
@ -122,24 +123,24 @@ const fetchBoardDetails = async () => {
const boardDetail = data.boardDetail || {};
// console.log('boardDetail:', boardDetail);
console.log('API Response:', response.data);
profileName.value = data.author || '익명 사용자';
boardTitle.value = data.title || '제목 없음';
boardContent.value = data.content || '';
date.value = data.date || '';
views.value = data.cnt || 0;
likes.value = data.likeCount || 0;
dislikes.value = data.dislikeCount || 0;
attachment.value = data.hasAttachment || null;
attachments.value = data.attachments || [];
comments.value = data.comments || [];
comments.value = data.commentCount || 0;
console.log(date.value)
} catch (error) {
alert('게시물 데이터를 불러오는 중 오류가 발생했습니다.');
}
};
const currentLikeCount = ref(10);
const currentDislikeCount = ref(2);
// ,
const handleUpdateReaction = async ({ type, boardId, commentId }) => {
try {