Commit c3096e26ff24c8afd9555e676c898030664846d7
1 parent
1d7608ee
fix(table): fix table check column configuration failure close #391
Showing
3 changed files
with
6 additions
and
3 deletions
CHANGELOG.zh_CN.md
src/components/Table/src/components/settings/ColumnSetting.vue
... | ... | @@ -113,6 +113,7 @@ |
113 | 113 | |
114 | 114 | import { isNullAndUnDef } from '/@/utils/is'; |
115 | 115 | import { getPopupContainer } from '/@/utils'; |
116 | + import { omit } from 'lodash-es'; | |
116 | 117 | |
117 | 118 | import type { BasicColumn } from '../../types/table'; |
118 | 119 | |
... | ... | @@ -147,7 +148,7 @@ |
147 | 148 | const { t } = useI18n(); |
148 | 149 | const table = useTableContext(); |
149 | 150 | |
150 | - const defaultRowSelection = table.getRowSelection(); | |
151 | + const defaultRowSelection = omit(table.getRowSelection(), 'selectedRowKeys'); | |
151 | 152 | let inited = false; |
152 | 153 | |
153 | 154 | const cachePlainOptions = ref<Options[]>([]); |
... | ... |
src/components/Table/src/hooks/useRowSelection.ts
... | ... | @@ -16,10 +16,11 @@ export function useRowSelection( |
16 | 16 | if (!rowSelection) { |
17 | 17 | return null; |
18 | 18 | } |
19 | + | |
19 | 20 | return { |
20 | 21 | selectedRowKeys: unref(selectedRowKeysRef), |
21 | 22 | hideDefaultSelections: false, |
22 | - onChange: (selectedRowKeys: string[], selectedRows: any[]) => { | |
23 | + onChange: (selectedRowKeys: string[], selectedRows: Recordable[]) => { | |
23 | 24 | selectedRowKeysRef.value = selectedRowKeys; |
24 | 25 | selectedRowRef.value = selectedRows; |
25 | 26 | emit('selection-change', { |
... | ... | @@ -27,7 +28,7 @@ export function useRowSelection( |
27 | 28 | rows: selectedRows, |
28 | 29 | }); |
29 | 30 | }, |
30 | - ...rowSelection, | |
31 | + ...(rowSelection === undefined ? {} : rowSelection), | |
31 | 32 | }; |
32 | 33 | }); |
33 | 34 | |
... | ... |