fix(FormTable): Invert select bug (#3412)
This commit is contained in:
parent
23b684977c
commit
595b1ce680
|
|
@ -61,10 +61,12 @@
|
||||||
function onSelect(record, selected) {
|
function onSelect(record, selected) {
|
||||||
if (selected) {
|
if (selected) {
|
||||||
state.selectedRowKeys.push(record.id);
|
state.selectedRowKeys.push(record.id);
|
||||||
} else {
|
return;
|
||||||
state.selectedRowKeys
|
}
|
||||||
.splice(0)
|
const delIdx = state.selectedRowKeys.indexOf(record.id);
|
||||||
.push(...state.selectedRowKeys.filter((id) => id !== record.id));
|
|
||||||
|
if (delIdx !== -1) {
|
||||||
|
state.selectedRowKeys.splice(delIdx, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue