첨부파일 수정
This commit is contained in:
parent
922fc09c2d
commit
5bd56faf11
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<BoardProfile :profileName="comment.author" :showDetail="false" :author="true" />
|
||||
<BoardProfile :profileName="comment.author" :showDetail="false" :author="true" :isChild="isChild" />
|
||||
<div class="mt-6">
|
||||
<p class="m-0">{{ comment.content }}</p>
|
||||
</div>
|
||||
@ -14,7 +14,7 @@
|
||||
:key="child.id"
|
||||
class="pt-8 ps-10"
|
||||
>
|
||||
<BoardComment :comment="child" :isPlusButton="false" @submitComment="addChildComment" />
|
||||
<BoardComment :comment="child" :isPlusButton="false" :isChild="true" @submitComment="addChildComment" />
|
||||
</li>
|
||||
</ul>
|
||||
<!-- <ul class="list-unstyled twoDepth">
|
||||
@ -46,7 +46,11 @@ const props = defineProps({
|
||||
isPlusButton: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
}
|
||||
},
|
||||
isChild: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
|
||||
// emits 정의
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<div class="d-flex justify-content-between align-items-center flex-wrap mb-6 gap-2">
|
||||
<!-- 제목 섹션 -->
|
||||
<div class="me-1">
|
||||
<h5 class="mb-0">{{ boardTitle }}</h5>
|
||||
<h5 class="mb-0">{{ boardTitle }}adada</h5>
|
||||
</div>
|
||||
<!-- 첨부파일 섹션 -->
|
||||
<div v-if="dropdownItems.length > 0" class="btn-group">
|
||||
|
||||
@ -38,7 +38,7 @@
|
||||
<i class='bx bx-trash'></i>
|
||||
</button> -->
|
||||
</template>
|
||||
<BoardRecommendBtn :isRecommend="false" />
|
||||
<BoardRecommendBtn v-if="!isChild" :isRecommend="false" />
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
@ -84,6 +84,10 @@ const props = defineProps({
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
isChild: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
}
|
||||
});
|
||||
|
||||
const boardId = 100; //수정필요!!
|
||||
|
||||
@ -16,12 +16,33 @@
|
||||
</div>
|
||||
<!-- 게시글 내용 -->
|
||||
<div class="card-body">
|
||||
<h5 class="mb-4">{{ boardTitle }}</h5>
|
||||
<!-- HTML 콘텐츠 렌더링 -->
|
||||
<div class="board-content text-body" style="line-height: 1.6;" v-html="$common.contentToHtml(boardContent)">
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center flex-wrap mb-6 gap-2">
|
||||
<!-- 제목 섹션 -->
|
||||
<div class="me-1">
|
||||
<h5 class="mb-4">{{ boardTitle }}</h5>
|
||||
</div>
|
||||
|
||||
<!-- 첨부파일 섹션 -->
|
||||
<div v-if="attachments" class="btn-group">
|
||||
<button type="button" class="btn btn-label-secondary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<i class="fa-solid fa-download me-2"></i>
|
||||
첨부파일
|
||||
<!-- (<span class="attachment-num">{{ dropdownItems.length }}</span>) -->
|
||||
</button>
|
||||
<!-- <ul class="dropdown-menu">
|
||||
<li v-for="(item, index) in dropdownItems" :key="index">
|
||||
<a class="dropdown-item" href="javascript:void(0);">
|
||||
{{ item.label }}
|
||||
</a>
|
||||
</li>
|
||||
</ul> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- HTML 콘텐츠 렌더링 -->
|
||||
<div class="board-content text-body" style="line-height: 1.6;" v-html="$common.contentToHtml(boardContent)"></div>
|
||||
|
||||
<!-- 좋아요 버튼 -->
|
||||
<div class="row justify-content-center my-10">
|
||||
<BoardRecommendBtn
|
||||
@ -35,11 +56,11 @@
|
||||
</div>
|
||||
|
||||
<!-- 첨부파일 목록 -->
|
||||
<ul v-if="attachments.length" class="attachments mt-4 list-unstyled">
|
||||
<!-- <ul v-if="attachments.length" class="attachments mt-4 list-unstyled">
|
||||
<li v-for="(attachment, index) in attachments" :key="index" class="mb-2">
|
||||
<a :href="attachment.url" target="_blank" class="text-decoration-none">{{ attachment.name }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</ul> -->
|
||||
|
||||
<!-- 댓글 영역 -->
|
||||
<BoardComentArea :comments="comments" />
|
||||
@ -79,6 +100,7 @@ const attachments = ref([]);
|
||||
const views = ref(0);
|
||||
const likes = ref(0);
|
||||
const dislikes = ref(0);
|
||||
const attachment = ref(false);
|
||||
|
||||
// 라우트에서 ID 가져오기
|
||||
const route = useRoute();
|
||||
@ -108,6 +130,7 @@ const fetchBoardDetails = async () => {
|
||||
views.value = data.cnt || 0;
|
||||
likes.value = data.likeCount || 0;
|
||||
dislikes.value = data.dislikeCount || 0;
|
||||
attachment.value = data.hasAttachment || null;
|
||||
|
||||
attachments.value = data.attachments || [];
|
||||
comments.value = data.comments || [];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user