diff --git a/src/components/list/BoardCard.vue b/src/components/list/BoardCard.vue index f15061b..327e1e7 100644 --- a/src/components/list/BoardCard.vue +++ b/src/components/list/BoardCard.vue @@ -18,7 +18,12 @@ {{ category }} -
{{ title }}
+
+ {{ title }} + + + +

{{ content }}

@@ -81,6 +86,10 @@ const props = defineProps({ type: Number, default: 0, }, + attachment: { + type: Boolean, + default: false, + } }); // computed 속성 diff --git a/src/components/list/BoardCardList.vue b/src/components/list/BoardCardList.vue index 3c66287..23f55ca 100644 --- a/src/components/list/BoardCardList.vue +++ b/src/components/list/BoardCardList.vue @@ -13,6 +13,7 @@ :views="post.views" :likes="post.likes" :comments="post.comments" + :attachment="post.attachment" /> diff --git a/src/views/board/BoardList.vue b/src/views/board/BoardList.vue index a3af0b9..2f5d056 100644 --- a/src/views/board/BoardList.vue +++ b/src/views/board/BoardList.vue @@ -11,10 +11,9 @@
- + +
@@ -27,7 +26,7 @@
-
+

공지사항

@@ -73,7 +72,7 @@ import axios from '@api'; const generalList = ref([]); const noticeList = ref([]); const searchText = ref(''); -const selectedOrder = ref(''); +const selectedOrder = ref('date'); const sortDirection = ref('desc'); const pagination = ref({ currentPage: 1, @@ -104,17 +103,6 @@ const search = (e) => { // 정렬 변경 핸들러 const handleSortChange = (event) => { - const value = event.target.value; - if (value === 'view') { - selectedOrder.value = 'view'; - sortDirection.value = 'desc'; - } else if (value === 'date') { - selectedOrder.value = 'date'; - sortDirection.value = 'desc'; - } else { - selectedOrder.value = ''; - sortDirection.value = 'desc'; - }; fetchGeneralPosts(1); }; @@ -139,6 +127,7 @@ const fetchGeneralPosts = async (page = 1) => { views: post.cnt || 0, likes: post.likeCount || 0, comments: post.commentCount || 0, + attachment: post.hasAttachment || false, })); // 페이지네이션 정보 업데이트 @@ -177,6 +166,7 @@ const fetchNoticePosts = async () => { views: post.cnt || 0, likes: post.likeCount || 0, comments: post.commentCount || 0, + attachment: post.hasAttachment || false, })); } else { console.error("데이터 오류:", response.data);