미디어 업로드와 태그 표시 수정
This commit is contained in:
@@ -180,13 +180,6 @@ const createTagBadgeStyle = (color) => ({
|
||||
color
|
||||
})
|
||||
|
||||
/**
|
||||
* 게시물의 대표 태그 슬러그를 반환한다.
|
||||
* @param {Object} post - 게시물
|
||||
* @returns {string} 첫 번째 태그 슬러그
|
||||
*/
|
||||
const getRepresentativeTagSlug = (post) => post.tags?.[0] || ''
|
||||
|
||||
const usedTagSlugs = computed(() => {
|
||||
const slugs = new Set()
|
||||
for (const post of posts.value) {
|
||||
@@ -591,12 +584,14 @@ watch(openPostMenuId, async (postId) => {
|
||||
</span>
|
||||
</td>
|
||||
<td class="admin-posts__cell px-4 py-4">
|
||||
<div v-if="getRepresentativeTagSlug(post)" class="admin-posts__tag-list flex flex-wrap gap-1.5">
|
||||
<div v-if="post.tags?.length" class="admin-posts__tag-list flex flex-wrap gap-1.5">
|
||||
<span
|
||||
v-for="tag in post.tags"
|
||||
:key="tag"
|
||||
class="admin-posts__tag-badge inline-flex h-6 items-center rounded-[3px] border px-2 text-xs font-semibold"
|
||||
:style="createTagBadgeStyle(getTagColor(getRepresentativeTagSlug(post)))"
|
||||
:style="createTagBadgeStyle(getTagColor(tag))"
|
||||
>
|
||||
{{ getTagName(getRepresentativeTagSlug(post)) }}
|
||||
{{ getTagName(tag) }}
|
||||
</span>
|
||||
</div>
|
||||
<span v-else class="admin-posts__tag-empty text-muted">-</span>
|
||||
|
||||
Reference in New Issue
Block a user