From 13afb220607484e9d7d636df911e741e3efcbf6d Mon Sep 17 00:00:00 2001 From: chenxing Date: Fri, 9 Oct 2026 17:08:28 +0800 Subject: [PATCH] =?UTF-8?q?feat(layout):=20=E8=8F=9C=E5=8D=95=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E5=85=9C=E5=BA=95=20icon-list=EF=BC=88=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E6=9C=AA=E9=85=8D=E7=BD=AE=E6=97=B6=E6=81=92=E6=9C=89?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E4=BF=9D=E7=BC=A9=E8=BF=9B=E4=B8=80=E8=87=B4?= =?UTF-8?q?=EF=BC=89+=20=E9=9D=A2=E5=8C=85=E5=B1=91=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E5=9B=9E=E5=BD=92=E8=A1=8C=E5=86=85=E5=9F=BA?= =?UTF-8?q?=E7=BA=BF=E6=B5=81=EF=BC=88-0.125em=20=E5=85=89=E5=AD=A6?= =?UTF-8?q?=E5=B1=85=E4=B8=AD=EF=BC=8C=E4=BF=AE=20inline-flex=20=E9=A6=96?= =?UTF-8?q?=E9=A1=B9=E6=97=A0=E5=AD=97=E5=9B=BE=E6=A0=87=E5=9F=BA=E7=BA=BF?= =?UTF-8?q?=E6=8A=8A=E6=95=B4=E7=9B=92=E9=A1=B6=E9=AB=98=204px=20=E7=9A=84?= =?UTF-8?q?=E9=94=99=E4=BD=8D=EF=BC=89+=20=E9=80=9A=E9=81=93=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E6=88=B3=E8=B7=9F=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/layout.vue | 23 +++++++++++------------ src/utils/theme.ts | 2 +- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/components/layout.vue b/src/components/layout.vue index 1976df5..db0dc29 100644 --- a/src/components/layout.vue +++ b/src/components/layout.vue @@ -161,11 +161,9 @@ const childChange = (index: number) => { /** 菜单图标:读取用户中心模块管理配置的 YschIcons 图标名(GetUserMod 的 icon 字段,如 list → icon-list)。 * icons.css(ysch-icons 掩码版,基类 iconfont,类名 icon-<名称>)现由中央静态通道下发; - * 平台约定留空不下发图标,此时返回空串由模板 v-if 不渲染 */ -const getMenuIcon = (item?: any): string => { - const icon = String(item?.icon || "").trim(); - return icon ? `icon-${icon}` : ""; -}; + * 平台未配置图标时统一兜底 icon-list(2026-10-09 定稿:菜单项恒有图标,保整列缩进/行高一致) */ +const getMenuIcon = (item?: any): string => + `icon-${String(item?.icon || "").trim() || "list"}`; function linkHomePage() { if (baseHost.value) { @@ -206,7 +204,7 @@ function linkHomePage() {
  • - + {{ item.name }}
  • @@ -226,7 +224,7 @@ function linkHomePage() {
  • - + {{ item.name }}
  • @@ -293,13 +291,14 @@ function linkHomePage() { /* 面包屑「首页」垂直居中:骨架遗留的 .path-nav .icon-category{position:relative;top:1px} 是给老 iconfont 字体字形做的基线补偿,换成 ysch mask 的 1em 方块后反而把图标顶偏; 这里用 inline-flex 真居中并关掉该补偿(不动通道产物,覆盖收在本组件内) */ -.crumb-home { - display: inline-flex; - align-items: center; - gap: 4px; -} +/* 面包屑「首页」与后续级目的文字对齐(2026-10-09 定稿):此前 .crumb-home 用 inline-flex, + 行内级盒的基线取首项——16px 无字图标(其基线=方块底缘),整盒被顶高约 4px,首页文字 + 比相邻级目高。改回普通行内流:图标(.iconfont 基类 inline-block,基线=底缘)以 -0.125em + 基线偏移做光学居中,文字与相邻级目共用同一行盒基线,天然对齐 */ .crumb-home .iconfont { position: static; top: 0; + margin-right: 4px; + vertical-align: -0.125em; } \ No newline at end of file diff --git a/src/utils/theme.ts b/src/utils/theme.ts index 6b1dba2..b9ca566 100644 --- a/src/utils/theme.ts +++ b/src/utils/theme.ts @@ -1,5 +1,5 @@ /** - * 本文件由 YschTheme scripts/gen-theme.mjs 从 assets-src/pc/theme-core.js 生成(版本 20261009-1038-1688389),勿手改。 + * 本文件由 YschTheme scripts/gen-theme.mjs 从 assets-src/pc/theme-core.js 生成(版本 20261009-1655-488a3c3),勿手改。 * 分发方式:YschTheme `npm run sync` 拷进各端 src/utils/theme.ts(与 ThemeSwitcher.vue 配套,MD5 对齐报告)。 * 运行时档位类名由 /static/js/yh-theme-init.js 在 内先行挂好,本模块只负责读写与切换。 */