fix(Table): fix the problem that selectedRow has no value

This commit is contained in:
xzdry 2022-06-13 09:56:33 +08:00
parent 3f76911745
commit 37a163f3f1

View File

@ -487,6 +487,16 @@ export const Table = implementRuntimeComponent({
checkCrossPage: checkCrossPage,
// This option is required to achieve multi-selection across pages when customizing paging
preserveSelectedRowKeys: useCustomPagination ? checkCrossPage : undefined,
onSelect: (selected, record) => {
mergeState({
selectedRow: selected ? record : undefined,
});
},
onSelectAll: () => {
mergeState({
selectedRow: undefined,
});
},
onChange(selectedRowKeys, selectedRows) {
mergeState({
selectedRowKeys: selectedRowKeys as string[],