diff --git a/src/components/board/BoardProfile.vue b/src/components/board/BoardProfile.vue index 9640046..c15a60b 100644 --- a/src/components/board/BoardProfile.vue +++ b/src/components/board/BoardProfile.vue @@ -10,13 +10,13 @@ 2024.12.10 10:46 - 1 + {{ views }} - 1 + {{ likes }} - 1 + {{ dislikes }} @@ -38,7 +38,7 @@ --> - + @@ -50,13 +50,12 @@ import axios from '@api'; import DeleteButton from '../button/DeleteBtn.vue'; import EditButton from '../button/EditBtn.vue'; import BoardRecommendBtn from '../button/BoardRecommendBtn.vue'; -import { onMounted } from 'vue'; // Vue Router 인스턴스 const router = useRouter(); // Props 정의 -defineProps({ +const props = defineProps({ profileName: { type: String, default: '익명', @@ -73,6 +72,22 @@ defineProps({ type: Boolean, default: false, }, + views: { + type: Number, + default: 0, + }, + likes: { + type: Number, + default: null, + }, + dislikes: { + type: Number, + default: null, + }, + isChild: { + type: Boolean, + default: false, + } }); const boardId = 100; //수정필요!! @@ -89,7 +104,6 @@ const handleDelete = async () => { alert('게시물이 성공적으로 삭제되었습니다.'); router.push({ name: 'BoardList' }); } catch (error) { - console.error('게시물 삭제 중 오류 발생:', error); alert('게시물 삭제에 실패했습니다.'); } } diff --git a/src/components/list/BoardCard.vue b/src/components/list/BoardCard.vue index 1ddac0f..3f22a7d 100644 --- a/src/components/list/BoardCard.vue +++ b/src/components/list/BoardCard.vue @@ -1,142 +1,124 @@ - - - - - - - - - - - - {{ category }} - - - - {{ title }} - - - - - - {{ content }} - - - {{ formattedDate }} - - - - {{ views || 0 }} - - - {{ likes }} - - - {{ comments }} - - - - - - + + + + + + + {{ category }} + + + + {{ title }} + + + + + + {{ content }} + + + {{ formattedDate }} + + + {{ views || 0 }} + + + {{ comments }} + + + {{ likes }} + + + {{ dislikes }} + + + + - + - -// formattedDate을 computed로 정의 -const formattedDate = computed(() => { - const date = new Date(props.date); - return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, "0")}-${String( - date.getDate() - ).padStart(2, "0")} ${String(date.getHours()).padStart(2, "0")}:${String( - date.getMinutes() - ).padStart(2, "0")}`; -}); - - - + diff --git a/src/components/list/BoardCardList.vue b/src/components/list/BoardCardList.vue index f727c6e..430a73d 100644 --- a/src/components/list/BoardCardList.vue +++ b/src/components/list/BoardCardList.vue @@ -1,21 +1,25 @@ - + + 게시물이 없습니다. - + goDetail(post.id)" + :attachment="post.attachment || false" + @click="() => goDetail(post.id)" /> + diff --git a/src/views/board/BoardList.vue b/src/views/board/BoardList.vue index 1c1c2c3..89eb2e8 100644 --- a/src/views/board/BoardList.vue +++ b/src/views/board/BoardList.vue @@ -2,7 +2,7 @@ - + @@ -13,23 +13,7 @@ - - - - - - 공지사항 - - - - - - - - - - 일반게시판 - + @@ -38,6 +22,16 @@ + + + + + + + + + + @@ -64,7 +58,6 @@ -
{{ content }}
+ {{ formattedDate }} +
게시물이 없습니다.