diff --git a/src/components/board/BoardComment.vue b/src/components/board/BoardComment.vue index 1d4a85c..9147773 100644 --- a/src/components/board/BoardComment.vue +++ b/src/components/board/BoardComment.vue @@ -4,7 +4,7 @@ :unknown="comment.author === '익명'" :isCommentAuthor="isCommentAuthor" :boardId="comment.boardId" - :profileName="comment.nickname ? comment.nickname : comment.author" + :profileName="displayName" :date="comment.createdAt" :comment="comment" :profileImg="comment.profileImg" @@ -76,10 +76,15 @@ type: Boolean, default: false, }, + nickname: { + type: String, + default: '', + }, isCommentAuthor: { type: Boolean, default: false, }, + isPlusButton: { type: Boolean, default: true, @@ -113,6 +118,10 @@ editCommentAlert: String, }); + const displayName = computed(() => { + return props.nickname? props.nickname: props.comment.author; + }); + // emits 정의 const emit = defineEmits([ 'submitComment', diff --git a/src/components/board/BoardCommentList.vue b/src/components/board/BoardCommentList.vue index 64c634d..49ec969 100644 --- a/src/components/board/BoardCommentList.vue +++ b/src/components/board/BoardCommentList.vue @@ -7,6 +7,7 @@ :isCommentAuthor="comment.isCommentAuthor" :isEditTextarea="comment.isEditTextarea" :isDeleted="isDeleted" + :nickname="comment.nickname" :isCommentPassword="isCommentPassword" :passwordCommentAlert="passwordCommentAlert || ''" :currentPasswordCommentId="currentPasswordCommentId" @@ -32,6 +33,7 @@ :isPlusButton="false" :isLike="true" :isCommentProfile="true" + :nickname="child.nickname" :isCommentAuthor="child.isCommentAuthor" :isCommentPassword="isCommentPassword" :currentPasswordCommentId="currentPasswordCommentId" diff --git a/src/components/board/BoardProfile.vue b/src/components/board/BoardProfile.vue index abb6ced..be278f8 100644 --- a/src/components/board/BoardProfile.vue +++ b/src/components/board/BoardProfile.vue @@ -12,7 +12,7 @@