From 43afa8c56c3a287ffaef065352b67d63416ffdb7 Mon Sep 17 00:00:00 2001 From: mavis Date: Mon, 15 Jun 2026 19:42:40 +0800 Subject: [PATCH] =?UTF-8?q?style(search):=20=E7=AE=80=E5=8C=96=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E9=A1=B9,=E5=8F=AA=E6=98=BE=E7=A4=BA=E8=AF=8D?= =?UTF-8?q?=E6=96=87=E6=9C=AC(=E5=8E=BB=E6=8E=89'=E8=AF=8D'=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E5=92=8C=20weight=20=E6=95=B0=E5=AD=97)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 产品反馈:下拉项'词英国 694'样式花,只要'英国'两个干净的字就行。 renderSuggestion 简化成单个 span,删掉 .feed-suggest-tag 和 .feed-suggest-weight CSS。 --- frontend/src/views/Feed.vue | 43 ++++--------------------------------- 1 file changed, 4 insertions(+), 39 deletions(-) diff --git a/frontend/src/views/Feed.vue b/frontend/src/views/Feed.vue index 2b62c49..9b64c8b 100644 --- a/frontend/src/views/Feed.vue +++ b/frontend/src/views/Feed.vue @@ -95,17 +95,9 @@ const suggestOptions = computed(() => { })) }) -// 自定义 render:显示"词"标签 + 词文本 + 权重 +// 自定义 render:只显示词文本(干净,不挂标签/数字) function renderSuggestion(opt: SuggestOption) { - return h( - 'div', - { class: 'feed-suggest-row' }, - [ - h('span', { class: 'feed-suggest-tag feed-suggest-tag-keyword' }, '词'), - h('span', { class: 'feed-suggest-text' }, opt.label), - h('span', { class: 'feed-suggest-weight' }, String(opt.meta.weight)), - ], - ) + return h('span', { class: 'feed-suggest-text' }, opt.label) } // 选完候选词:naive-ui 把 value 写回 v-model,我们从 suggestOptions 找 meta @@ -705,39 +697,12 @@ onMounted(async () => { width: 100%; } -/* === 搜索建议下拉项 === */ -.feed-suggest-row { - display: flex; - align-items: center; - gap: 8px; - min-width: 0; -} -.feed-suggest-tag { - display: inline-flex; - align-items: center; - padding: 1px 6px; - border-radius: 8px; - font-size: 11px; - font-weight: 600; - line-height: 1.4; - flex-shrink: 0; -} -.feed-suggest-tag-keyword { - background: #f3e8ff; - color: #6b21a8; -} +/* === 搜索建议下拉项(干净版,只显示词本身) === */ .feed-suggest-text { + display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; - flex: 1; - min-width: 0; -} -.feed-suggest-weight { - flex-shrink: 0; - font-size: 11px; - color: #94a3b8; - font-variant-numeric: tabular-nums; } /* ===== 移动端(<= 768px):过滤条全宽,允许换行 ===== */