fix bug: default sort doesnot dismiss

pull/2309/head
njleonzhang 2017-01-11 09:48:09 +08:00
parent 203bc070d9
commit 22cea4e6c4
1 changed files with 7 additions and 3 deletions

View File

@ -197,13 +197,17 @@ export default {
this.$nextTick(_ => { this.$nextTick(_ => {
for (let i = 0, length = this.columns.length; i < length; i++) { for (let i = 0, length = this.columns.length; i < length; i++) {
if (this.columns[i].property === this.defaultSortProp) { let column = this.columns[i];
this.columns[i].order = this.defaultSortOrder; if (column.property === this.defaultSortProp) {
column.order = this.defaultSortOrder;
states.sortingColumn = column;
break; break;
} }
} }
this.store.commit('changeSortCondition'); if (states.sortingColumn) {
this.store.commit('changeSortCondition');
}
}); });
} }
}, },