mirror of
https://github.com/Hopiu/vue-material.git
synced 2026-03-16 22:10:27 +00:00
fixing bug. issue #869
This commit is contained in:
parent
9abe1f242f
commit
482a948885
1 changed files with 8 additions and 5 deletions
|
|
@ -51,12 +51,15 @@
|
|||
emitSelection() {
|
||||
this.$emit('select', this.selectedRows);
|
||||
},
|
||||
removeRow(row, array = null) {
|
||||
const list = array || this.data;
|
||||
const index = list.indexOf(row);
|
||||
removeRow(row) {
|
||||
const index = this.data.indexOf(row);
|
||||
const selectedIndex = this.selectedRows.indexOf(row);
|
||||
|
||||
if (index !== -1) {
|
||||
list.splice(index, 1);
|
||||
this.data.splice(index, 1);
|
||||
}
|
||||
if (selectedIndex !== -1) {
|
||||
this.selectedRows.splice(selectedIndex, 1);
|
||||
}
|
||||
},
|
||||
setRowSelection(isSelected, row) {
|
||||
|
|
@ -64,7 +67,7 @@
|
|||
this.selectedRows.push(row);
|
||||
return;
|
||||
}
|
||||
this.removeRow(row, this.selectedRows);
|
||||
this.removeRow(row);
|
||||
},
|
||||
setMultipleRowSelection(isSelected) {
|
||||
this.selectedRows = isSelected ?
|
||||
|
|
|
|||
Loading…
Reference in a new issue