Skip to content

Commit 6d787bd

Browse files
VdustRmarcosmoura
authored andcommitted
fix(MdTableRow): removeSelectableItem when empty (#1616)
fix #1610
1 parent 4f180f6 commit 6d787bd

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/components/MdTable/MdTableRow.vue

+4-6
Original file line numberDiff line numberDiff line change
@@ -116,21 +116,19 @@
116116
},
117117
addSelectableItem () {
118118
if (!this.hasMultipleSelection || this.mdDisabled) {
119-
return
119+
return false
120120
}
121121
122122
if (this.MdTable.selectable.includes(this.mdItem)) {
123-
return
123+
return false
124124
}
125125
126126
this.MdTable.selectable.push(this.mdItem)
127127
},
128128
removeSelectableItem (target = this.mdItem) {
129-
if (!this.hasMultipleSelection) {
130-
return
129+
if (this.mdSelectable === 'multiple') {
130+
this.MdTable.selectable = this.MdTable.selectable.filter(item => item !== target)
131131
}
132-
133-
this.MdTable.selectable = this.MdTable.selectable.filter(item => item !== target)
134132
}
135133
},
136134
created () {

0 commit comments

Comments
 (0)