From bf5e826bbecb8133106bc551bb209791f7d18d4f Mon Sep 17 00:00:00 2001 From: liyy <18435186204@163.com> Date: Thu, 3 Sep 2026 14:44:40 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20AppStack=E6=9E=81=E7=AE=80=E5=8C=96?= =?UTF-8?q?=E4=B8=BAdirection+gap=EF=BC=8C=E5=93=8D=E5=BA=94=E5=BC=8F?= =?UTF-8?q?=E6=96=B9=E5=90=91=E7=94=B1=E4=BD=BF=E7=94=A8=E9=A1=B5=E4=BC=A0?= =?UTF-8?q?=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/components/base/AppStack.vue | 56 +++---------------------- client/src/views/mock/MockView.vue | 37 ++++++++-------- 2 files changed, 23 insertions(+), 70 deletions(-) diff --git a/client/src/components/base/AppStack.vue b/client/src/components/base/AppStack.vue index fcdc35d..bf0621d 100644 --- a/client/src/components/base/AppStack.vue +++ b/client/src/components/base/AppStack.vue @@ -3,27 +3,17 @@ import { computed } from 'vue' const props = withDefaults( defineProps<{ - /** 主轴方向;默认纵向 */ + /** 单行横向 / 单列纵向;默认纵向。响应式由使用处自行决定传 row 还是 column */ direction?: 'row' | 'column' /** - * 子项间距。兼容三种写法: - * - token 名:space-3 / space-4 / space-5 … - * - 纯数字字符串:'12' → 12px - * - 其它 CSS 值:'12px 16px'、'var(--space-3)' 等原样透传 - * 缺省:纵向 space-5(20px),横向 space-4(16px) + * 子项间距:token 名(space-3…)或纯数字字符串('12' → 12px)。 + * 缺省:纵向 space-5(20px)、横向 space-4(16px)。 */ gap?: string - /** 交叉轴对齐 */ - align?: 'start' | 'center' | 'end' | 'stretch' | 'baseline' - /** 主轴对齐 */ - justify?: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly' - /** 是否允许换行(横向时使用) */ - wrap?: boolean }>(), - { direction: 'column', gap: '', align: 'stretch', justify: 'start', wrap: false } + { direction: 'column', gap: '' } ) -/** token 名 / 纯数字 → 兼容的 CSS gap;其它原样透传 */ const gapStyle = computed(() => { const raw = props.gap.trim() if (!raw) return props.direction === 'row' ? 'var(--space-4)' : 'var(--space-5)' @@ -36,12 +26,7 @@ const gapStyle = computed(() => { diff --git a/client/src/views/mock/MockView.vue b/client/src/views/mock/MockView.vue index 51b6eda..ff08097 100644 --- a/client/src/views/mock/MockView.vue +++ b/client/src/views/mock/MockView.vue @@ -120,7 +120,12 @@ async function confirmRemove() {