From 2d2ba5933cdab8d14df31ae13d975e9e9fce1ba2 Mon Sep 17 00:00:00 2001 From: VdustR Date: Wed, 30 May 2018 22:17:06 +0800 Subject: [PATCH] fix(MdTable): provide value mutation assign value instead of mutate value to avoid unexpected behavior fix #1786 --- src/components/MdTable/MdTable.vue | 2 +- src/components/MdTable/MdTableRow.vue | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/MdTable/MdTable.vue b/src/components/MdTable/MdTable.vue index 65685a72b..46db65a9e 100644 --- a/src/components/MdTable/MdTable.vue +++ b/src/components/MdTable/MdTable.vue @@ -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 () { diff --git a/src/components/MdTable/MdTableRow.vue b/src/components/MdTable/MdTableRow.vue index 5ded08dc4..9ee886f3b 100644 --- a/src/components/MdTable/MdTableRow.vue +++ b/src/components/MdTable/MdTableRow.vue @@ -95,7 +95,7 @@ }, addSelection () { if (!this.isMultipleSelected) { - this.MdTable.selectedItems.push(this.mdItem) + this.MdTable.selectedItems = this.MdTable.selectedItems.concat([this.mdItem]) } }, removeSelection () { @@ -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') {