This commit is contained in:
parent
57e3489af5
commit
e8753588ca
@ -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',
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
</div>
|
||||
|
||||
<div class="me-2">
|
||||
<h6 class="mb-0">{{ displayName }}</h6>
|
||||
<h6 class="mb-0">{{ profileName ? profileName : nickname }}</h6>
|
||||
<div class="profile-detail">
|
||||
<span>{{ date }}</span>
|
||||
<template v-if="showDetail">
|
||||
@ -58,11 +58,11 @@
|
||||
type: Number,
|
||||
required: false,
|
||||
},
|
||||
nickname: {
|
||||
profileName: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
profileName: {
|
||||
nickname: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
@ -105,10 +105,6 @@
|
||||
const emit = defineEmits(['updateReaction', 'editClick', 'deleteClick']);
|
||||
const $common = inject('common');
|
||||
|
||||
const displayName = computed(() => {
|
||||
return props.nickname?props.nickname : props.name;
|
||||
});
|
||||
|
||||
const isDeletedComment = computed(() => {
|
||||
return props.comment?.content === '삭제된 댓글입니다' && props.comment?.updateAtRaw !== props.comment?.createdAtRaw;
|
||||
});
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
<div class="pb-5 border-bottom">
|
||||
<BoardProfile
|
||||
:boardId="currentBoardId"
|
||||
:profileName="profileName"
|
||||
:profileName="displayName"
|
||||
:unknown="unknown"
|
||||
:profileImg="profileImg"
|
||||
:views="views"
|
||||
@ -176,6 +176,10 @@
|
||||
const authorId = ref(''); // 작성자 id
|
||||
const editCommentAlert = ref({}); //댓글, 대댓글 오류 메세지 객체
|
||||
|
||||
const displayName = computed(() => {
|
||||
return nickname.value && unknown.value ? nickname.value : profileName.value;
|
||||
});
|
||||
|
||||
const isAuthor = computed(() => currentUserId.value === authorId.value);
|
||||
const commentsWithAuthStatus = computed(() => {
|
||||
const updatedComments = comments.value.map(comment => ({
|
||||
@ -325,7 +329,7 @@
|
||||
likeCount: comment.likeCount || 0,
|
||||
dislikeCount: comment.dislikeCount || 0,
|
||||
profileImg: comment.profileImg || '',
|
||||
nickname: comment.LOCCMTNIC,
|
||||
nickname: comment.LOCCMTNIC || '',
|
||||
likeClicked: comment.likeClicked || false,
|
||||
dislikeClicked: comment.dislikeClicked || false,
|
||||
createdAtRaw: comment.LOCCMTRDT, // 작성일
|
||||
@ -355,7 +359,7 @@
|
||||
parentId: reply.LOCCMTPNT, // 부모 댓글 ID
|
||||
content: reply.LOCCMTRPY || '내용 없음',
|
||||
createdAtRaw: reply.LOCCMTRDT,
|
||||
nickname: reply.LOCCMTNIC,
|
||||
nickname: reply.LOCCMTNIC || '',
|
||||
// createdAt: formattedDate(reply.LOCCMTRDT),
|
||||
//createdAtRaw: new Date(reply.LOCCMTUDT),
|
||||
createdAt: formattedDate(reply.LOCCMTUDT) + (reply.LOCCMTUDT !== reply.LOCCMTRDT ? ' (수정됨)' : ''),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user