Table: Add silent for filter-chagne

pull/4039/merge
Liril 2017-04-07 18:35:42 +08:00 committed by 杨奕
parent d652e73f74
commit d184e9c0b6
2 changed files with 6 additions and 3 deletions

View File

@ -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());
},

View File

@ -374,7 +374,8 @@
if (column.filteredValue && column.filteredValue.length) {
this.store.commit('filterChange', {
column,
values: column.filteredValue
values: column.filteredValue,
silent: true
});
}
});