썸네일 이미지

This commit is contained in:
kimdaae328 2025-01-24 15:39:30 +09:00
parent 758a717d47
commit e4df111725
2 changed files with 6 additions and 6 deletions

View File

@ -2,7 +2,7 @@
<div class="card mb-3 shadow-sm"> <div class="card mb-3 shadow-sm">
<div class="row g-0"> <div class="row g-0">
<!-- 이미지 섹션 --> <!-- 이미지 섹션 -->
<div v-if="img" class="col-md-2"> <div v-if="img" class="col-sm-2">
<img <img
:src="img" :src="img"
alt="이미지" alt="이미지"
@ -27,10 +27,10 @@
<!-- 본문 --> <!-- 본문 -->
<div class="card-text str_wrap my-5">{{ content }}</div> <div class="card-text str_wrap my-5">{{ content }}</div>
<!-- 날짜 --> <!-- 날짜 -->
<div class="d-flex justify-content-between"> <div class="d-flex flex-column flex-sm-row justify-content-between align-items-start">
<small class="text-muted">{{ formattedDate }}</small> <small class="text-muted">{{ formattedDate }}</small>
<!-- 조회수, 좋아요, 댓글 --> <!-- 조회수, 좋아요, 댓글 -->
<div> <div class="d-flex mt-2 mt-sm-0">
<span class="text-muted me-3"> <span class="text-muted me-3">
<i class="fa-regular fa-eye"></i> {{ views || 0 }} <i class="fa-regular fa-eye"></i> {{ views || 0 }}
</span> </span>
@ -94,7 +94,7 @@ const props = defineProps({
// computed // computed
const contentColClass = computed(() => { const contentColClass = computed(() => {
return props.img ? 'col-md-10 col-12' : 'col-md-12'; return props.img ? 'col-sm-10 col-12' : 'col-sm-12';
}); });
// formattedDate computed // formattedDate computed

View File

@ -131,7 +131,7 @@ const fetchGeneralPosts = async (page = 1) => {
generalList.value = data.list.map((post, index) => ({ generalList.value = data.list.map((post, index) => ({
...post, ...post,
id: post.id || index, id: post.id || index,
img: post.img || null, img: post.firstImageUrl || null,
views: post.cnt || 0, views: post.cnt || 0,
likes: post.likeCount != null ? post.likeCount : null, likes: post.likeCount != null ? post.likeCount : null,
comments: post.commentCount != null ? post.commentCount : null, comments: post.commentCount != null ? post.commentCount : null,
@ -171,7 +171,7 @@ const fetchNoticePosts = async () => {
noticeList.value = response.data.data.map((post, index) => ({ noticeList.value = response.data.data.map((post, index) => ({
...post, ...post,
id: post.id || index, id: post.id || index,
img: post.img || null, img: post.firstImageUrl || null,
views: post.cnt || 0, views: post.cnt || 0,
attachment: post.hasAttachment || false, attachment: post.hasAttachment || false,
content: post.plainContent || '', content: post.plainContent || '',