提交 aa596af6 编写于 作者: V vben

fix(table): table columns setting will uncheck all render columns #154

上级 0419a070
......@@ -250,7 +250,7 @@
if (props.record) {
/* eslint-disable */
isArray(props.record[cbs])
? props.record[cbs].push(handle)
? props.record[cbs]?.push(handle)
: (props.record[cbs] = [handle]);
}
}
......@@ -267,9 +267,9 @@
/* eslint-disable */
props.record.onSubmitEdit = async () => {
if (isArray(props.record?.submitCbs)) {
const validFns = props.record?.validCbs || [];
const validFns = (props.record?.validCbs || []).map((fn) => fn());
const res = await Promise.all(validFns.map((fn) => fn()));
const res = await Promise.all(validFns);
const pass = res.every((item) => !!item);
if (!pass) return;
......
......@@ -185,13 +185,14 @@ export function useColumns(
const columnKeys = columns as string[];
const newColumns: BasicColumn[] = [];
cacheColumns.forEach((item) => {
if (columnKeys.includes(`${item.key}`! || item.dataIndex!)) {
if (columnKeys.includes(item.dataIndex! || (item.key as string))) {
newColumns.push({
...item,
defaultHidden: false,
});
}
});
// Sort according to another array
if (!isEqual(cacheKeys, columns)) {
newColumns.sort((prev, next) => {
......
......@@ -109,7 +109,7 @@ const setting: ProjectConfig = {
// Switch page to close menu
closeMixSidebarOnChange: false,
// Module opening method ‘click’ |'hover'
mixSideTrigger: 'hover',
mixSideTrigger: 'click',
},
// Multi-label
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册