mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-01-26 12:48:48 +08:00
修复 init 运行时机不正确 (#1452)
修复去掉checkList 后,移动配置中的table顺序后,调用tabel.setColum() 时触发 init() ,导致checkList 被重置bug
This commit is contained in:
parent
ab62739fd1
commit
23b5538eae
@ -124,6 +124,7 @@
|
|||||||
|
|
||||||
interface State {
|
interface State {
|
||||||
checkAll: boolean;
|
checkAll: boolean;
|
||||||
|
isInit: boolean;
|
||||||
checkedList: string[];
|
checkedList: string[];
|
||||||
defaultCheckList: string[];
|
defaultCheckList: string[];
|
||||||
}
|
}
|
||||||
@ -180,7 +181,7 @@
|
|||||||
|
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
const columns = table.getColumns();
|
const columns = table.getColumns();
|
||||||
if (columns.length) {
|
if (columns.length && !state.isInit) {
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -233,6 +234,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
state.isInit = true;
|
||||||
state.checkedList = checkList;
|
state.checkedList = checkList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user