diff --git a/package-lock.json b/package-lock.json
index 76b850a..7a47e84 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -18,6 +18,7 @@
"axios": "^1.7.9",
"bootstrap": "^5.3.3",
"dayjs": "^1.11.13",
+ "dompurify": "^3.2.3",
"flatpickr": "^4.6.13",
"front": "file:",
"heic2any": "^0.0.4",
@@ -1483,6 +1484,12 @@
"integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==",
"dev": true
},
+ "node_modules/@types/trusted-types": {
+ "version": "2.0.7",
+ "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz",
+ "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==",
+ "optional": true
+ },
"node_modules/@vitejs/plugin-vue": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-5.2.1.tgz",
@@ -2258,6 +2265,14 @@
"node": ">=0.4.0"
}
},
+ "node_modules/dompurify": {
+ "version": "3.2.3",
+ "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.2.3.tgz",
+ "integrity": "sha512-U1U5Hzc2MO0oW3DF+G9qYN0aT7atAou4AgI0XjWz061nyBPbdxkfdhfy5uMgGn6+oLFCfn44ZGbdDqCzVmlOWA==",
+ "optionalDependencies": {
+ "@types/trusted-types": "^2.0.7"
+ }
+ },
"node_modules/dunder-proto": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
diff --git a/package.json b/package.json
index 638b6a7..823ef27 100644
--- a/package.json
+++ b/package.json
@@ -21,6 +21,7 @@
"axios": "^1.7.9",
"bootstrap": "^5.3.3",
"dayjs": "^1.11.13",
+ "dompurify": "^3.2.3",
"flatpickr": "^4.6.13",
"front": "file:",
"heic2any": "^0.0.4",
diff --git a/src/components/board/BoardComment.vue b/src/components/board/BoardComment.vue
index e71b3ee..7ebe4a5 100644
--- a/src/components/board/BoardComment.vue
+++ b/src/components/board/BoardComment.vue
@@ -1,56 +1,77 @@
-
- -
-
-
저도 궁금합니다.
-
-
-
-
- -
-
-
저도 궁금합니다.
-
-
-
- -
-
-
저도 궁금합니다.
-
-
-
-
-
+
+
+
+
{{ comment.content }}
+
+
+
+
+
+
+
+
+
diff --git a/src/components/board/BoardCommentList.vue b/src/components/board/BoardCommentList.vue
new file mode 100644
index 0000000..319345c
--- /dev/null
+++ b/src/components/board/BoardCommentList.vue
@@ -0,0 +1,48 @@
+
+
+
+
+
diff --git a/src/components/board/BoardContent.vue b/src/components/board/BoardContent.vue
index 2b5abbd..7b46e86 100644
--- a/src/components/board/BoardContent.vue
+++ b/src/components/board/BoardContent.vue
@@ -3,7 +3,7 @@
-
{{ boardTitle }}
+ {{ boardTitle }}adada
diff --git a/src/components/board/BoardProfile.vue b/src/components/board/BoardProfile.vue
index c8a90c3..d5091f5 100644
--- a/src/components/board/BoardProfile.vue
+++ b/src/components/board/BoardProfile.vue
@@ -10,13 +10,13 @@
2024.12.10 10:46
- 1
+ {{ views }}
- 1
+ {{ likes }}
- 1
+ {{ dislikes }}
@@ -29,14 +29,16 @@
-
-
+
@@ -48,13 +50,12 @@ import axios from '@api';
import DeleteButton from '../button/DeleteBtn.vue';
import EditButton from '../button/EditBtn.vue';
import BoardRecommendBtn from '../button/BoardRecommendBtn.vue';
-import { onMounted } from 'vue';
// Vue Router 인스턴스
const router = useRouter();
// Props 정의
-defineProps({
+const props = defineProps({
profileName: {
type: String,
default: '익명',
@@ -71,6 +72,22 @@ defineProps({
type: Boolean,
default: false,
},
+ views: {
+ type: Number,
+ default: 0,
+ },
+ likes: {
+ type: Number,
+ default: null,
+ },
+ dislikes: {
+ type: Number,
+ default: null,
+ },
+ isChild: {
+ type: Boolean,
+ default: false,
+ }
});
const boardId = 100; //수정필요!!
diff --git a/src/components/button/BoardRecommendBtn.vue b/src/components/button/BoardRecommendBtn.vue
index d2452b1..b179da3 100644
--- a/src/components/button/BoardRecommendBtn.vue
+++ b/src/components/button/BoardRecommendBtn.vue
@@ -1,14 +1,16 @@
-
-
diff --git a/src/components/list/BoardCard.vue b/src/components/list/BoardCard.vue
index 456aa3e..fe0eecc 100644
--- a/src/components/list/BoardCard.vue
+++ b/src/components/list/BoardCard.vue
@@ -1,141 +1,124 @@
-
-
-
-
-
![이미지]()
-
-
-
-
-
-
- {{ category }}
-
-
-
- {{ title }}
-
-
-
-
-
-
-
-
-
{{ formattedDate }}
-
-
-
- {{ views || 0 }}
-
-
- {{ likes }}
-
-
- {{ comments }}
-
-
-
-
-
-
+
+
+
![이미지]()
+
+
+
+ {{ category }}
+
+
+
+ {{ title }}
+
+
+
+
+
+
{{ content }}
+
+
+ {{ formattedDate }}
+
+
+ {{ views || 0 }}
+
+
+ {{ comments }}
+
+
+ {{ likes }}
+
+
+ {{ dislikes }}
+
+
+
+
-
+
-
-// formattedDate을 computed로 정의
-const formattedDate = computed(() => {
- const date = new Date(props.date);
- return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, "0")}-${String(
- date.getDate()
- ).padStart(2, "0")} ${String(date.getHours()).padStart(2, "0")}:${String(
- date.getMinutes()
- ).padStart(2, "0")}`;
-});
-
-
-
+
diff --git a/src/components/list/BoardCardList.vue b/src/components/list/BoardCardList.vue
index f727c6e..430a73d 100644
--- a/src/components/list/BoardCardList.vue
+++ b/src/components/list/BoardCardList.vue
@@ -1,21 +1,25 @@
-
+
+
-
+
goDetail(post.id)"
+ :attachment="post.attachment || false"
+ @click="() => goDetail(post.id)"
/>
+
diff --git a/src/views/board/BoardList.vue b/src/views/board/BoardList.vue
index 87c4d0a..89eb2e8 100644
--- a/src/views/board/BoardList.vue
+++ b/src/views/board/BoardList.vue
@@ -1,36 +1,19 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
일반게시판
-
+
+
+
+
+
+
+
@@ -131,11 +124,13 @@ 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,
+ likes: post.likeCount != null ? post.dislikeCount : null,
+ dislikes: post.dislikeCount != null ? post.likeCount : null,
comments: post.commentCount != null ? post.commentCount : null,
attachment: post.hasAttachment || false,
+ content: post.plainContent || '',
}));
// 페이지네이션 정보 업데이트
@@ -170,9 +165,10 @@ 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 || '',
}));
} else {
console.error("데이터 오류:", response.data);
diff --git a/src/views/board/BoardView.vue b/src/views/board/BoardView.vue
index fd20dc0..18df4be 100644
--- a/src/views/board/BoardView.vue
+++ b/src/views/board/BoardView.vue
@@ -5,29 +5,75 @@
-
{{ boardTitle }}
-
-
+
+
+
+
{{ boardTitle }}
+
+
+
+
+
+
+ 첨부파일
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
@@ -38,18 +84,23 @@