From 8f81a19e4831da49356c374ba035388dc483ade8 Mon Sep 17 00:00:00 2001 From: zhaojisen <1301338853@qq.com> Date: Mon, 19 Jan 2026 17:51:59 +0800 Subject: [PATCH] perf: Optimize the display of table columns --- ui/components/Card/TableCard/tableCard.vue | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ui/components/Card/TableCard/tableCard.vue b/ui/components/Card/TableCard/tableCard.vue index ecfec01..de5675f 100644 --- a/ui/components/Card/TableCard/tableCard.vue +++ b/ui/components/Card/TableCard/tableCard.vue @@ -206,7 +206,7 @@ const columns: TableColumn[] = [ "onUpdate:modelValue": (value: boolean | "indeterminate") => row.toggleSelected(!!value), "aria-label": "Select row" }), - meta: { class: { th: "w-[50px]", td: "w-[50px]" } } + meta: { class: { th: "w-[5%] min-w-[40px]", td: "w-[5%] min-w-[40px]" } } }, { accessorKey: "assetName", @@ -255,7 +255,7 @@ const columns: TableColumn[] = [ } ); }, - meta: { class: { th: "max-w-[300px]", td: "max-w-[300px]" } } + meta: { class: { th: "w-[28%]", td: "w-[28%]" } } }, { accessorKey: "address", @@ -269,7 +269,7 @@ const columns: TableColumn[] = [ }, row.original.address ), - meta: { class: { th: "max-w-[300px]", td: "max-w-[300px]" } } + meta: { class: { th: "w-[28%]", td: "w-[28%]" } } }, { id: "user", @@ -285,7 +285,7 @@ const columns: TableColumn[] = [ userText ); }, - meta: { class: { th: "w-[250px]", td: "w-[250px]" } } + meta: { class: { th: "w-[18%]", td: "w-[18%]" } } }, { id: "protocol", @@ -303,7 +303,7 @@ const columns: TableColumn[] = [ return h(UButton, { size: "xs", class: "rounded-sm", variant: "subtle", color: "primary" }, () => protocolText); }, - meta: { class: { th: "w-[150px]", td: "w-[150px]" } } + meta: { class: { th: "w-[7%]", td: "w-[7%]" } } }, { id: "actions", @@ -351,7 +351,7 @@ const columns: TableColumn[] = [ } ); }, - meta: { class: { th: "w-[260px] text-center", td: "w-[260px] text-center" } } + meta: { class: { th: "w-[14%] text-center", td: "w-[14%] text-center" } } } ]; @@ -370,10 +370,10 @@ const columns: TableColumn[] = [ :data="props.items" :columns="columns" :empty="t('Common.NoData')" - class="w-full table-auto" + class="w-full min-w-[900px] table-fixed" :ui="{ tr: 'hover:bg-muted/50 ', - th: 'whitespace-nowrap text-xs sm:text-sm', + th: 'whitespace-nowrap text-xs sm:text-sm truncate', td: 'whitespace-nowrap text-xs sm:text-sm py-2' }" />