From 507419b6d6b8fd4a4595f762543618b33cb8458d Mon Sep 17 00:00:00 2001 From: TermiNexus Date: Wed, 30 Sep 2026 19:08:54 +0800 Subject: [PATCH] =?UTF-8?q?style(global):=20el-empty=20=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E5=B1=85=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit el-empty 默认宽度随内容收缩,作为 grid/flex 子项时会停在首列而偏左 (应用中心 /app/mine、/app/market 的 .app-grid 卡片栅格最明显)。 全局统一:grid 容器中跨满整行 + 撑满可用宽度 + 文本居中,覆盖全站 el-empty。 --- src/styles/global.scss | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/styles/global.scss b/src/styles/global.scss index d2904fc..074cc04 100644 --- a/src/styles/global.scss +++ b/src/styles/global.scss @@ -375,6 +375,7 @@ html.dark { box-shadow: var(--gerp-shadow-hover); } } + /* ---------- 18. 禁止文本选中(导航/侧边栏/交互控件/标题类 UI) ---------- * 布局框架(顶部 nav + 侧边栏)与交互型控件不允许选中文字, * 避免拖选时选中整片导航文字;正文内容(表格数据/详情文本/输入框)保持可选中。 @@ -420,3 +421,16 @@ html.dark { -moz-user-select: none; -ms-user-select: none; } + +/* ---------- 19. 空状态(el-empty):统一居中 ---------- + * el-empty 自身虽是「flex 列 + align-items:center」,但宽度默认随内容收缩; + * 一旦作为 grid / flex 子项(如应用中心 .app-grid 卡片栅格)就会停在首列而偏左。 + * 这里统一撑满可用宽度,并在 grid 容器中跨满整行,保证任何容器下都水平居中。 + */ +.el-empty { + grid-column: 1 / -1; + width: 100%; + margin: 0 auto; + box-sizing: border-box; + text-align: center; +}