From 1cdb02c9d786e523a28aa0b6d6b3df93678d7b4f Mon Sep 17 00:00:00 2001 From: casbal Date: Tue, 10 Aug 2021 17:05:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=9F=BA=E6=9C=AC=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=88=97=E5=9B=BA=E5=AE=9A=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E6=B7=BB=E5=8A=A0action=E5=88=97=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E7=9A=84=E6=A0=B7=E5=BC=8F=E9=94=99=E4=B9=B1=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Table/src/hooks/useColumns.ts | 4 ++-- src/views/list/basicList/index.vue | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Table/src/hooks/useColumns.ts b/src/components/Table/src/hooks/useColumns.ts index 42cb8ae..fe02104 100644 --- a/src/components/Table/src/hooks/useColumns.ts +++ b/src/components/Table/src/hooks/useColumns.ts @@ -94,7 +94,7 @@ export function useColumns(propsRef: ComputedRef) { const { actionColumn } = unref(propsRef); if (!actionColumn) return; // @ts-ignore - columns.push({ + !columns.find((col) => col.key === 'action') && columns.push({ ...actionColumn, }); } @@ -129,7 +129,7 @@ export function useColumns(propsRef: ComputedRef) { } //获取 - function getColumns() { + function getColumns(): BasicColumn[] { const columns = toRaw(unref(getColumnsRef)); return columns.map((item) => { return { ...item, title: item.title, key: item.key, fixed: item.fixed || undefined }; diff --git a/src/views/list/basicList/index.vue b/src/views/list/basicList/index.vue index e707303..1236f07 100644 --- a/src/views/list/basicList/index.vue +++ b/src/views/list/basicList/index.vue @@ -231,7 +231,7 @@ name: 'xiaoMa', }, actionColumn: { - width: 140, + width: 220, title: '操作', key: 'action', fixed: 'right',