썸네일 이미지
This commit is contained in:
parent
758a717d47
commit
e4df111725
@ -2,7 +2,7 @@
|
||||
<div class="card mb-3 shadow-sm">
|
||||
<div class="row g-0">
|
||||
<!-- 이미지 섹션 -->
|
||||
<div v-if="img" class="col-md-2">
|
||||
<div v-if="img" class="col-sm-2">
|
||||
<img
|
||||
:src="img"
|
||||
alt="이미지"
|
||||
@ -27,10 +27,10 @@
|
||||
<!-- 본문 -->
|
||||
<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>
|
||||
<!-- 조회수, 좋아요, 댓글 -->
|
||||
<div>
|
||||
<div class="d-flex mt-2 mt-sm-0">
|
||||
<span class="text-muted me-3">
|
||||
<i class="fa-regular fa-eye"></i> {{ views || 0 }}
|
||||
</span>
|
||||
@ -94,7 +94,7 @@ const props = defineProps({
|
||||
|
||||
// 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로 정의
|
||||
|
||||
@ -131,7 +131,7 @@ const fetchGeneralPosts = async (page = 1) => {
|
||||
generalList.value = data.list.map((post, index) => ({
|
||||
...post,
|
||||
id: post.id || index,
|
||||
img: post.img || null,
|
||||
img: post.firstImageUrl || null,
|
||||
views: post.cnt || 0,
|
||||
likes: post.likeCount != null ? post.likeCount : null,
|
||||
comments: post.commentCount != null ? post.commentCount : null,
|
||||
@ -171,7 +171,7 @@ const fetchNoticePosts = async () => {
|
||||
noticeList.value = response.data.data.map((post, index) => ({
|
||||
...post,
|
||||
id: post.id || index,
|
||||
img: post.img || null,
|
||||
img: post.firstImageUrl || null,
|
||||
views: post.cnt || 0,
|
||||
attachment: post.hasAttachment || false,
|
||||
content: post.plainContent || '',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user