From d184e9c0b6fcb11f2ea7e43f8e46f7f33563cc67 Mon Sep 17 00:00:00 2001 From: Liril Date: Fri, 7 Apr 2017 18:35:42 +0800 Subject: [PATCH] Table: Add silent for filter-chagne --- packages/table/src/table-store.js | 6 ++++-- packages/table/src/table.vue | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/table/src/table-store.js b/packages/table/src/table-store.js index 05ab70005..697abdb26 100644 --- a/packages/table/src/table-store.js +++ b/packages/table/src/table-store.js @@ -146,7 +146,7 @@ TableStore.prototype.mutations = { }, filterChange(states, options) { - let { column, values } = options; + let { column, values, silent } = options; if (values && !Array.isArray(values)) { values = [values]; } @@ -175,7 +175,9 @@ TableStore.prototype.mutations = { states.filteredData = data; states.data = sortData(data, states); - this.table.$emit('filter-change', filters); + if (!silent) { + this.table.$emit('filter-change', filters); + } Vue.nextTick(() => this.table.updateScrollY()); }, diff --git a/packages/table/src/table.vue b/packages/table/src/table.vue index e1ee9bd74..b9ca386cb 100644 --- a/packages/table/src/table.vue +++ b/packages/table/src/table.vue @@ -374,7 +374,8 @@ if (column.filteredValue && column.filteredValue.length) { this.store.commit('filterChange', { column, - values: column.filteredValue + values: column.filteredValue, + silent: true }); } });