Skip to content

Commit

Permalink
fix(MdTable): provide value mutation (#1789)
Browse files Browse the repository at this point in the history
assign value instead of mutate value to avoid unexpected behavior

fix #1786
  • Loading branch information
VdustR authored and Samuell1 committed Jun 7, 2018
1 parent 21d7e67 commit ae38547
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/MdTable/MdTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@
if (this.MdTable.selectedItems.includes(item)) {
this.MdTable.selectedItems = this.MdTable.selectedItems.filter(target => target !== item)
} else {
this.MdTable.selectedItems.push(item)
this.MdTable.selectedItems = this.MdTable.selectedItems.concat([item])
}
},
sortTable () {
Expand Down
4 changes: 2 additions & 2 deletions src/components/MdTable/MdTableRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
},
addSelection () {
if (!this.isMultipleSelected) {
this.MdTable.selectedItems.push(this.mdItem)
this.MdTable.selectedItems = this.MdTable.selectedItems.concat([this.mdItem])
}
},
removeSelection () {
Expand Down Expand Up @@ -124,7 +124,7 @@
return false
}
this.MdTable.selectable.push(this.mdItem)
this.MdTable.selectable = this.MdTable.selectable.concat([this.mdItem])
},
removeSelectableItem (target = this.mdItem) {
if (this.mdSelectable === 'multiple') {
Expand Down

0 comments on commit ae38547

Please sign in to comment.