From 7f9881fbc4bf29e1279eeeb3101b08f817f120c3 Mon Sep 17 00:00:00 2001 From: xingyu Date: Wed, 10 May 2023 18:35:47 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=AE=8C=E5=96=84ColumnSetting?= =?UTF-8?q?=E7=9A=84=E6=93=8D=E4=BD=9C=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Table/src/BasicTable.vue | 5 +- .../src/components/settings/ColumnSetting.vue | 95 +++++++++++++------ src/components/Table/src/hooks/useColumns.ts | 7 +- src/components/Table/src/types/table.ts | 1 + 4 files changed, 76 insertions(+), 32 deletions(-) diff --git a/src/components/Table/src/BasicTable.vue b/src/components/Table/src/BasicTable.vue index f51387f0..7d97adf5 100644 --- a/src/components/Table/src/BasicTable.vue +++ b/src/components/Table/src/BasicTable.vue @@ -160,7 +160,7 @@ function handleTableChange(...args) { onChange && isFunction(onChange) && onChange.call(undefined, ...args) } -const { getViewColumns, getColumns, setCacheColumnsByField, setColumns, getColumnsRef, getCacheColumns } = useColumns( +const { getViewColumns, getColumns, setCacheColumnsByField, setCacheColumns, setColumns, getColumnsRef, getCacheColumns } = useColumns( getProps, getPaginationInfo ) @@ -292,7 +292,8 @@ const tableAction: TableActionType = { scrollTo, getSize: () => { return unref(getBindValues).size as SizeType - } + }, + setCacheColumns } createTableContext({ ...tableAction, wrapRef, getBindValues }) diff --git a/src/components/Table/src/components/settings/ColumnSetting.vue b/src/components/Table/src/components/settings/ColumnSetting.vue index 00493a37..6c97eb32 100644 --- a/src/components/Table/src/components/settings/ColumnSetting.vue +++ b/src/components/Table/src/components/settings/ColumnSetting.vue @@ -83,7 +83,7 @@