날짜 수정 완료
This commit is contained in:
parent
d1aa5fb438
commit
57c81b36a5
@ -9,7 +9,7 @@
|
|||||||
<div class="profile-detail">
|
<div class="profile-detail">
|
||||||
<span>{{ date }}</span>
|
<span>{{ date }}</span>
|
||||||
<template v-if="showDetail">
|
<template v-if="showDetail">
|
||||||
<span>
|
<span class="ms-2">
|
||||||
<i class="fa-regular fa-eye"></i> {{ views }}
|
<i class="fa-regular fa-eye"></i> {{ views }}
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
@ -42,6 +42,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { computed, defineProps } from 'vue';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import axios from '@api';
|
import axios from '@api';
|
||||||
import DeleteButton from '../button/DeleteBtn.vue';
|
import DeleteButton from '../button/DeleteBtn.vue';
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
:profileName="profileName"
|
:profileName="profileName"
|
||||||
:views="views"
|
:views="views"
|
||||||
:comments="comments"
|
:comments="comments"
|
||||||
:date="date"
|
:date="formattedBoardDate"
|
||||||
class="pb-6 border-bottom"
|
class="pb-6 border-bottom"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@ -87,7 +87,7 @@ import BoardProfile from '@c/board/BoardProfile.vue';
|
|||||||
import BoardCommentList from '@/components/board/BoardCommentList.vue';
|
import BoardCommentList from '@/components/board/BoardCommentList.vue';
|
||||||
import BoardRecommendBtn from '@/components/button/BoardRecommendBtn.vue';
|
import BoardRecommendBtn from '@/components/button/BoardRecommendBtn.vue';
|
||||||
import Pagination from '@/components/pagination/Pagination.vue';
|
import Pagination from '@/components/pagination/Pagination.vue';
|
||||||
import { ref, onMounted } from 'vue';
|
import { ref, onMounted, computed } from 'vue';
|
||||||
import { useRoute, useRouter } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
import axios from '@api';
|
import axios from '@api';
|
||||||
|
|
||||||
@ -152,6 +152,12 @@ const handleUpdateReaction = async ({ type, boardId, commentId }) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 날짜
|
||||||
|
const formattedBoardDate = computed(() => {
|
||||||
|
const dateObj = new Date(date.value);
|
||||||
|
return `${dateObj.getFullYear()}-${String(dateObj.getMonth() + 1).padStart(2, '0')}-${String(dateObj.getDate()).padStart(2, '0')} ${String(dateObj.getHours()).padStart(2, '0')}:${String(dateObj.getMinutes()).padStart(2, '0')}`;
|
||||||
|
});
|
||||||
|
|
||||||
// 컴포넌트 마운트 시 데이터 로드
|
// 컴포넌트 마운트 시 데이터 로드
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fetchBoardDetails();
|
fetchBoardDetails();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user