아이콘 간격 수정

This commit is contained in:
nevermoregb 2025-03-06 12:15:37 +09:00
parent 6c4fc7ac8e
commit 6ac3d587f8

View File

@ -10,12 +10,8 @@
<div class="profile-detail"> <div class="profile-detail">
<span>{{ date }}</span> <span>{{ date }}</span>
<template v-if="showDetail"> <template v-if="showDetail">
<span class="ms-2"> <span class="ms-2"> <i class="fa-regular fa-eye"></i> {{ views }} </span>
<i class="fa-regular fa-eye"></i> {{ views }} <span class="ms-1"> <i class="bx bx-comment"></i> {{ commentNum }} </span>
</span>
<span>
<i class="bx bx-comment"></i> {{ commentNum }}
</span>
</template> </template>
</div> </div>
</div> </div>
@ -29,112 +25,104 @@
</template> </template>
<!-- 좋아요, 싫어요 버튼 (댓글에서만 표시) --> <!-- 좋아요, 싫어요 버튼 (댓글에서만 표시) -->
<BoardRecommendBtn <BoardRecommendBtn v-if="isLike" :boardId="boardId" :comment="comment" @updateReaction="handleUpdateReaction" />
v-if="isLike"
:boardId="boardId"
:comment="comment"
@updateReaction="handleUpdateReaction"
/>
</div> </div>
</div> </div>
</template> </template>
<script setup> <script setup>
import { computed, defineProps, defineEmits } from 'vue'; import { computed, defineProps, defineEmits } from 'vue';
import DeleteButton from '../button/DeleteBtn.vue'; import DeleteButton from '../button/DeleteBtn.vue';
import EditButton from '../button/EditBtn.vue'; import EditButton from '../button/EditBtn.vue';
import BoardRecommendBtn from '../button/BoardRecommendBtn.vue'; import BoardRecommendBtn from '../button/BoardRecommendBtn.vue';
// //
const defaultProfile = "/img/icons/icon.png"; const defaultProfile = '/img/icons/icon.png';
// (Vue ) // (Vue )
const baseUrl = "http://localhost:10325/"; // API URL const baseUrl = 'http://localhost:10325/'; // API URL
// Props // Props
const props = defineProps({ const props = defineProps({
comment: { comment: {
type: Object, type: Object,
required: false, required: false,
}, },
boardId: { boardId: {
type: Number, type: Number,
required: false required: false,
}, },
commentId: { commentId: {
type: Number, type: Number,
required: false, required: false,
}, },
profileName: { profileName: {
type: String, type: String,
default: '', default: '',
}, },
profilePath: { profilePath: {
type: String, type: String,
default: '', default: '',
}, },
unknown: { unknown: {
type: Boolean, type: Boolean,
default: true, default: true,
}, },
showDetail: { showDetail: {
type: Boolean, type: Boolean,
default: true, default: true,
}, },
isAuthor: { isAuthor: {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
isCommentAuthor: Boolean, isCommentAuthor: Boolean,
isCommentProfile: Boolean, isCommentProfile: Boolean,
date: { date: {
type: String, type: String,
required: '', required: '',
}, },
views: { views: {
type: Number, type: Number,
default: 0, default: 0,
}, },
commentNum: { commentNum: {
type: Number, type: Number,
default: 0, default: 0,
}, },
isLike: { isLike: {
type: Boolean, type: Boolean,
default: false, default: false,
} },
});
const emit = defineEmits(['updateReaction', 'editClick', 'deleteClick']);
const isDeletedComment = computed(() => {
return props.comment?.content === '삭제된 댓글입니다' &&
props.comment?.updateAtRaw !== props.comment?.createdAtRaw;
});
//
const editClick = () => {
emit('editClick', { ...props.comment, unknown: props.unknown });
};
//
const deleteClick = () => {
emit('deleteClick', { ...props.comment, unknown: props.unknown });
};
// /
const handleUpdateReaction = (reactionData) => {
emit("updateReaction", {
boardId: props.boardId,
commentId: props.comment?.commentId,
...reactionData,
}); });
};
// const emit = defineEmits(['updateReaction', 'editClick', 'deleteClick']);
const getProfileImage = (profilePath) => {
return profilePath && profilePath.trim() const isDeletedComment = computed(() => {
? `${baseUrl}upload/img/profile/${profilePath}` return props.comment?.content === '삭제된 댓글입니다' && props.comment?.updateAtRaw !== props.comment?.createdAtRaw;
: defaultProfile; });
};
//
const editClick = () => {
emit('editClick', { ...props.comment, unknown: props.unknown });
};
//
const deleteClick = () => {
emit('deleteClick', { ...props.comment, unknown: props.unknown });
};
// /
const handleUpdateReaction = reactionData => {
emit('updateReaction', {
boardId: props.boardId,
commentId: props.comment?.commentId,
...reactionData,
});
};
//
const getProfileImage = profilePath => {
return profilePath && profilePath.trim() ? `${baseUrl}upload/img/profile/${profilePath}` : defaultProfile;
};
</script> </script>