Skip to content

Commit

Permalink
fix(table): table columns setting will uncheck all render columns #154
Browse files Browse the repository at this point in the history
  • Loading branch information
anncwb committed Jan 2, 2021
1 parent 0419a07 commit aa596af
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/components/Table/src/components/editable/EditableCell.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
}
Expand All @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion src/components/Table/src/hooks/useColumns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
2 changes: 1 addition & 1 deletion src/settings/projectSetting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit aa596af

Please sign in to comment.