Browse Source

修复 init 运行时机不正确 (#1452)

修复去掉checkList 后,移动配置中的table顺序后,调用tabel.setColum() 时触发 init() ,导致checkList 被重置bug
pull/1474/head
Jiang 5 years ago
committed by GitHub
parent
commit
23b5538eae
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/components/Table/src/components/settings/ColumnSetting.vue

4
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;
}

Loading…
Cancel
Save