mirror of
https://github.com/vbenjs/gf-vben-admin.git
synced 2025-01-23 20:00:19 +08:00
fix(table): fix table check column configuration failure close #391
This commit is contained in:
parent
1d7608ee40
commit
c3096e26ff
@ -17,6 +17,7 @@
|
|||||||
- 修复 Modal 组件 loadingTip 配置不生效
|
- 修复 Modal 组件 loadingTip 配置不生效
|
||||||
- 修复后台权限指令不生效
|
- 修复后台权限指令不生效
|
||||||
- 确保 progress 进度条正确关闭
|
- 确保 progress 进度条正确关闭
|
||||||
|
- 修复表格勾选列配置失效问题
|
||||||
|
|
||||||
## 2.1.0 (2021-03-15)
|
## 2.1.0 (2021-03-15)
|
||||||
|
|
||||||
|
@ -113,6 +113,7 @@
|
|||||||
|
|
||||||
import { isNullAndUnDef } from '/@/utils/is';
|
import { isNullAndUnDef } from '/@/utils/is';
|
||||||
import { getPopupContainer } from '/@/utils';
|
import { getPopupContainer } from '/@/utils';
|
||||||
|
import { omit } from 'lodash-es';
|
||||||
|
|
||||||
import type { BasicColumn } from '../../types/table';
|
import type { BasicColumn } from '../../types/table';
|
||||||
|
|
||||||
@ -147,7 +148,7 @@
|
|||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const table = useTableContext();
|
const table = useTableContext();
|
||||||
|
|
||||||
const defaultRowSelection = table.getRowSelection();
|
const defaultRowSelection = omit(table.getRowSelection(), 'selectedRowKeys');
|
||||||
let inited = false;
|
let inited = false;
|
||||||
|
|
||||||
const cachePlainOptions = ref<Options[]>([]);
|
const cachePlainOptions = ref<Options[]>([]);
|
||||||
|
@ -16,10 +16,11 @@ export function useRowSelection(
|
|||||||
if (!rowSelection) {
|
if (!rowSelection) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
selectedRowKeys: unref(selectedRowKeysRef),
|
selectedRowKeys: unref(selectedRowKeysRef),
|
||||||
hideDefaultSelections: false,
|
hideDefaultSelections: false,
|
||||||
onChange: (selectedRowKeys: string[], selectedRows: any[]) => {
|
onChange: (selectedRowKeys: string[], selectedRows: Recordable[]) => {
|
||||||
selectedRowKeysRef.value = selectedRowKeys;
|
selectedRowKeysRef.value = selectedRowKeys;
|
||||||
selectedRowRef.value = selectedRows;
|
selectedRowRef.value = selectedRows;
|
||||||
emit('selection-change', {
|
emit('selection-change', {
|
||||||
@ -27,7 +28,7 @@ export function useRowSelection(
|
|||||||
rows: selectedRows,
|
rows: selectedRows,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
...rowSelection,
|
...(rowSelection === undefined ? {} : rowSelection),
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user