diff --git a/src/components/list/ProjectCard.vue b/src/components/list/ProjectCard.vue index 5e7b03e..138df97 100644 --- a/src/components/list/ProjectCard.vue +++ b/src/components/list/ProjectCard.vue @@ -2,7 +2,7 @@
-
+
@@ -16,18 +16,6 @@
{{ formattedDate }} - -
- - {{ views || 0 }} - - - {{ likes }} - - - {{ comments }} - -
@@ -57,29 +45,12 @@ const props = defineProps({ type: String, required: true, }, - views: { - type: Number, - default: 0, - }, - likes: { - type: Number, - default: null, - }, - comments: { - type: Number, - default: null, - }, attachment: { type: Boolean, default: false, } }); -// computed 속성 -const contentColClass = computed(() => { - return props.img ? 'col-sm-10 col-12' : 'col-sm-12'; -}); - // formattedDate을 computed로 정의 const formattedDate = computed(() => { const date = new Date(props.date); diff --git a/src/components/list/ProjectCardList.vue b/src/components/list/ProjectCardList.vue index 4c17427..aed26b8 100644 --- a/src/components/list/ProjectCardList.vue +++ b/src/components/list/ProjectCardList.vue @@ -9,8 +9,6 @@ :title="post.title" :content="post.content" :date="post.date" - :views="post.views || 0" - v-bind="getProjectCardProps(post)" :attachment="post.attachment || false" />
@@ -28,8 +26,6 @@ const posts = ref([ title: 'Vue 3 Composition API 소개', content: 'Composition API를 사용하여 Vue 3에서 효율적으로 개발하는 방법을 알아봅니다. Composition API를 사용하여 Vue 3에서 효율적으로 개발하는 방법을 알아봅니다. Composition API를 사용하여 Vue 3에서 효율적으로 개발하는 방법을 알아봅니다. Composition API를 사용하여 Vue 3에서 효율적으로 개발하는 방법을 알아봅니다. Composition API를 사용하여 Vue 3에서 효율적으로 개발하는 방법을 알아봅니다. Composition API를 사용하여 Vue 3에서 효율적으로 개발하는 방법을 알아봅니다.', date: '2025-02-10', - views: 120, - likes: 15, comments: 4, attachment: true }, @@ -38,8 +34,6 @@ const posts = ref([ title: 'Spring Boot로 REST API 만들기', content: 'Spring Boot를 사용하여 간단한 RESTful API를 구현하는 방법을 다룹니다.', date: '2025-02-09', - views: 89, - likes: 8, comments: 2, attachment: false } @@ -52,15 +46,4 @@ const goDetail = (id) => { emit('click', id); }; -// 없는 데이터는 상위 페이지에서 삭제해도 되게끔 설정 -const getProjectCardProps = (post) => { - const projectCardProps = {}; - if ('likes' in post) { - projectCardProps.likes = post.likes; - } - if ('comments' in post) { - projectCardProps.comments = post.comments; - } - return projectCardProps; -}; diff --git a/src/components/projectlist/ProjectList.vue b/src/components/projectlist/ProjectList.vue new file mode 100644 index 0000000..bae6f34 --- /dev/null +++ b/src/components/projectlist/ProjectList.vue @@ -0,0 +1,19 @@ + + + diff --git a/src/views/projectlist/TheProjectList.vue b/src/views/projectlist/TheProjectList.vue index bf1de2a..502636a 100644 --- a/src/views/projectlist/TheProjectList.vue +++ b/src/views/projectlist/TheProjectList.vue @@ -1,24 +1,10 @@