From 024b2e176a15232b512a804b57be720179c38201 Mon Sep 17 00:00:00 2001 From: VdustR Date: Tue, 20 Mar 2018 23:42:17 +0800 Subject: [PATCH] fix(MdTableRow): removeSelectableItem when empty fix #1610 --- src/components/MdTable/MdTableRow.vue | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/components/MdTable/MdTableRow.vue b/src/components/MdTable/MdTableRow.vue index 2fc421eea..a13afe89e 100644 --- a/src/components/MdTable/MdTableRow.vue +++ b/src/components/MdTable/MdTableRow.vue @@ -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 () {