Merge branch 'boardmodify3'
This commit is contained in:
commit
5778a5dd4a
@ -7,6 +7,7 @@
|
||||
:profileName="comment.author"
|
||||
:date="comment.createdAt"
|
||||
:comment="comment"
|
||||
:profileImg="comment.profileImg"
|
||||
:showDetail="false"
|
||||
:isLike="!isLike"
|
||||
:isCommentPassword="isCommentPassword"
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<div class="d-flex align-items-center flex-wrap">
|
||||
<div class="d-flex align-items-center">
|
||||
<div v-if="!unknown" class="avatar me-2">
|
||||
<img :src="getProfileImage(profilePath)" alt="Avatar" class="rounded-circle" />
|
||||
<div class="avatar me-2">
|
||||
<img :src="getProfileImage(profileImg)" alt="Avatar" class="rounded-circle" />
|
||||
</div>
|
||||
|
||||
<div class="me-2">
|
||||
@ -60,10 +60,6 @@
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
profilePath: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
unknown: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
@ -94,6 +90,10 @@
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
profileImg: {
|
||||
type: String,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits(['updateReaction', 'editClick', 'deleteClick']);
|
||||
@ -122,7 +122,8 @@
|
||||
};
|
||||
|
||||
// 프로필 이미지 경로 설정
|
||||
const getProfileImage = profilePath => {
|
||||
return profilePath && profilePath.trim() ? `${baseUrl}upload/img/profile/${profilePath}` : defaultProfile;
|
||||
const getProfileImage = profileImg => {
|
||||
console.log('profileImg: ', profileImg);
|
||||
return profileImg && profileImg != '' ? `${baseUrl}upload/img/profile/${profileImg}` : defaultProfile;
|
||||
};
|
||||
</script>
|
||||
|
||||
@ -10,6 +10,7 @@
|
||||
:boardId="currentBoardId"
|
||||
:profileName="profileName"
|
||||
:unknown="unknown"
|
||||
:profileImg="profileImg"
|
||||
:views="views"
|
||||
:commentNum="commentNum"
|
||||
:date="formattedBoardDate"
|
||||
@ -150,6 +151,7 @@
|
||||
const commentNum = ref(0);
|
||||
const attachment = ref(false);
|
||||
const comments = ref([]);
|
||||
const profileImg = ref('');
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
@ -240,6 +242,7 @@
|
||||
authorId.value = data.authorId;
|
||||
boardTitle.value = data.title || '제목 없음';
|
||||
boardContent.value = data.content || '';
|
||||
profileImg.value = data.profileImg || '';
|
||||
date.value = data.date || '';
|
||||
views.value = data.cnt || 0;
|
||||
likes.value = data.likeCount || 0;
|
||||
@ -304,6 +307,7 @@
|
||||
content: comment.LOCCMTRPY,
|
||||
likeCount: comment.likeCount || 0,
|
||||
dislikeCount: comment.dislikeCount || 0,
|
||||
profileImg: comment.profileImg || '',
|
||||
likeClicked: comment.likeClicked || false,
|
||||
dislikeClicked: comment.dislikeClicked || false,
|
||||
createdAtRaw: new Date(comment.LOCCMTRDT), // 정렬용
|
||||
@ -325,6 +329,7 @@
|
||||
comment.children = replyResponse.data.data.map(reply => ({
|
||||
author: reply.author || '익명',
|
||||
authorId: reply.authorId,
|
||||
profileImg: reply.profileImg || '',
|
||||
commentId: reply.LOCCMTSEQ,
|
||||
boardId: reply.LOCBRDSEQ,
|
||||
parentId: reply.LOCCMTPNT, // 부모 댓글 ID
|
||||
@ -340,7 +345,7 @@
|
||||
comment.children = []; // 대댓글이 없으면 빈 배열로 초기화
|
||||
}
|
||||
}
|
||||
|
||||
commentsList;
|
||||
// 최종적으로 댓글 목록 업데이트
|
||||
comments.value = commentsList;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user