Skip to content

Commit

Permalink
fix(MdTableRow): removeSelectableItem when empty (#1616)
Browse files Browse the repository at this point in the history
fix #1610
  • Loading branch information
VdustR authored and marcosmoura committed Mar 27, 2018
1 parent 4f180f6 commit 6d787bd
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/components/MdTable/MdTableRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,21 +116,19 @@
},
addSelectableItem () {
if (!this.hasMultipleSelection || this.mdDisabled) {
return
return false
}
if (this.MdTable.selectable.includes(this.mdItem)) {
return
return false
}
this.MdTable.selectable.push(this.mdItem)
},
removeSelectableItem (target = this.mdItem) {
if (!this.hasMultipleSelection) {
return
if (this.mdSelectable === 'multiple') {
this.MdTable.selectable = this.MdTable.selectable.filter(item => item !== target)
}
this.MdTable.selectable = this.MdTable.selectable.filter(item => item !== target)
}
},
created () {
Expand Down

0 comments on commit 6d787bd

Please sign in to comment.