From 284bb8abe80a5402c23d4946a297f6602fcf47a6 Mon Sep 17 00:00:00 2001 From: gudzpoz Date: Tue, 31 Oct 2023 16:13:54 +0800 Subject: [PATCH] feat: use n-ellipsis --- src/components/LineList.vue | 39 ++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/src/components/LineList.vue b/src/components/LineList.vue index dcfdb03..0b86dcd 100644 --- a/src/components/LineList.vue +++ b/src/components/LineList.vue @@ -2,6 +2,7 @@ import { NButton, NButtonGroup, NCard, NCollapse, NCollapseItem, NIcon, NModal, NMenu, + NPerformantEllipsis, NSpace, NTag, NUpload, useDialog, type MenuOption, type UploadCustomRequestOptions, } from 'naive-ui'; @@ -113,11 +114,10 @@ function copyCurrent() { } } -function pruneHtml(html: string, limit = 10) { +function pruneHtml(html: string) { const container = document.createElement('div'); container.innerHTML = html; - const text = container.innerText; - return text.length > limit ? `${text.substring(0, limit)}...` : text; + return container.innerText; } function canMove(end: number) { @@ -323,18 +323,18 @@ function doIo(v: string) { @@ -344,6 +344,17 @@ function doIo(v: string) { .n-collapse { width: auto; } +.n-collapse .n-collapse-item__header-main { + width: 100%; +} +.n-collapse .n-collapse-item__header-main .line-header { + width: calc(100% - 24px); + display: inline-flex; + flex-wrap: nowrap; +} +.n-collapse .n-collapse-item__header-main .line-header > .n-tag { + margin-right: 1em; +} .n-collapse .n-collapse-item { --n-title-padding: 0; padding: 12px 12px 0 12px;