From 6100dc114c155cde9d8ecc3cd5d4d0af9c8a0d9c Mon Sep 17 00:00:00 2001 From: TermiNexus Date: Tue, 4 Aug 2026 04:02:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=20CRUD=20Table=20=E7=9A=84=E6=BB=9A?= =?UTF-8?q?=E5=8A=A8=E6=9D=A1=E5=8F=96=E6=B6=88=EF=BC=8C=E4=BD=BF=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E6=9B=B4=E5=8A=A0=E8=88=92=E6=9C=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/CrudTable.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/CrudTable.vue b/src/components/CrudTable.vue index 80ab8bc..967f6a7 100644 --- a/src/components/CrudTable.vue +++ b/src/components/CrudTable.vue @@ -44,6 +44,11 @@ const props = defineProps<{ maxHeight?: number }>() +// 表格实际使用的最大高度:显式 maxHeight 优先; +// stretch(整页列表)场景默认取视口高度 60%,保证表格与卡片一体、 +// 不产生页面级滚动栏(行多时表格内部滚动) +const tableMaxHeight = computed(() => props.maxHeight ?? (props.stretch ? Math.floor(window.innerHeight * 0.6) : undefined)) + const options: UseCrudTableOptions = { table: props.table, query: props.query, @@ -178,8 +183,8 @@ function renderUuid(value: unknown): string { border stripe round - :height="props.stretch ? '100%' : 'auto'" - :max-height="props.maxHeight" + :height="'auto'" + :max-height="tableMaxHeight" :row-config="{ isHover: true }" :column-config="{ resizable: true }" :checkbox-config="{ range: true }"