From 23b5538eae8c9737b9a4f1ae399cdce393dbb994 Mon Sep 17 00:00:00 2001 From: Jiang <49470702+qq34347476@users.noreply.github.com> Date: Sun, 12 Dec 2021 22:09:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20init=20=E8=BF=90=E8=A1=8C?= =?UTF-8?q?=E6=97=B6=E6=9C=BA=E4=B8=8D=E6=AD=A3=E7=A1=AE=20(#1452)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复去掉checkList 后,移动配置中的table顺序后,调用tabel.setColum() 时触发 init() ,导致checkList 被重置bug --- .../Table/src/components/settings/ColumnSetting.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/Table/src/components/settings/ColumnSetting.vue b/src/components/Table/src/components/settings/ColumnSetting.vue index db0e124e..3a06365d 100644 --- a/src/components/Table/src/components/settings/ColumnSetting.vue +++ b/src/components/Table/src/components/settings/ColumnSetting.vue @@ -124,6 +124,7 @@ interface State { checkAll: boolean; + isInit: boolean; checkedList: string[]; defaultCheckList: string[]; } @@ -180,7 +181,7 @@ watchEffect(() => { const columns = table.getColumns(); - if (columns.length) { + if (columns.length && !state.isInit) { init(); } }); @@ -233,6 +234,7 @@ } }); } + state.isInit = true; state.checkedList = checkList; }