Skip to content

Commit

Permalink
fix(FormTable): Invert select bug (#3412)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiaowoxiaobala committed Dec 14, 2023
1 parent 23b6849 commit 595b1ce
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/views/demo/table/FormTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,12 @@
function onSelect(record, selected) {
if (selected) {
state.selectedRowKeys.push(record.id);
} else {
state.selectedRowKeys
.splice(0)
.push(...state.selectedRowKeys.filter((id) => id !== record.id));
return;
}
const delIdx = state.selectedRowKeys.indexOf(record.id);
if (delIdx !== -1) {
state.selectedRowKeys.splice(delIdx, 1);
}
}
Expand Down

0 comments on commit 595b1ce

Please sign in to comment.