Skip to content

Commit

Permalink
fix(table): fix table check column configuration failure close #391
Browse files Browse the repository at this point in the history
  • Loading branch information
anncwb committed Mar 20, 2021
1 parent 1d7608e commit c3096e2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- 修复 Modal 组件 loadingTip 配置不生效
- 修复后台权限指令不生效
- 确保 progress 进度条正确关闭
- 修复表格勾选列配置失效问题

## 2.1.0 (2021-03-15)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
import { isNullAndUnDef } from '/@/utils/is';
import { getPopupContainer } from '/@/utils';
import { omit } from 'lodash-es';
import type { BasicColumn } from '../../types/table';
Expand Down Expand Up @@ -147,7 +148,7 @@
const { t } = useI18n();
const table = useTableContext();
const defaultRowSelection = table.getRowSelection();
const defaultRowSelection = omit(table.getRowSelection(), 'selectedRowKeys');
let inited = false;
const cachePlainOptions = ref<Options[]>([]);
Expand Down
5 changes: 3 additions & 2 deletions src/components/Table/src/hooks/useRowSelection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,19 @@ export function useRowSelection(
if (!rowSelection) {
return null;
}

return {
selectedRowKeys: unref(selectedRowKeysRef),
hideDefaultSelections: false,
onChange: (selectedRowKeys: string[], selectedRows: any[]) => {
onChange: (selectedRowKeys: string[], selectedRows: Recordable[]) => {
selectedRowKeysRef.value = selectedRowKeys;
selectedRowRef.value = selectedRows;
emit('selection-change', {
keys: selectedRowKeys,
rows: selectedRows,
});
},
...rowSelection,
...(rowSelection === undefined ? {} : rowSelection),
};
});

Expand Down

0 comments on commit c3096e2

Please sign in to comment.