From 22cea4e6c40289d2e51fb82973a82360c3ec1a84 Mon Sep 17 00:00:00 2001 From: njleonzhang Date: Wed, 11 Jan 2017 09:48:09 +0800 Subject: [PATCH] fix bug: default sort doesnot dismiss --- packages/table/src/table-header.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/table/src/table-header.js b/packages/table/src/table-header.js index 218eb5ccb..a0e277cc2 100644 --- a/packages/table/src/table-header.js +++ b/packages/table/src/table-header.js @@ -197,13 +197,17 @@ export default { this.$nextTick(_ => { for (let i = 0, length = this.columns.length; i < length; i++) { - if (this.columns[i].property === this.defaultSortProp) { - this.columns[i].order = this.defaultSortOrder; + let column = this.columns[i]; + if (column.property === this.defaultSortProp) { + column.order = this.defaultSortOrder; + states.sortingColumn = column; break; } } - this.store.commit('changeSortCondition'); + if (states.sortingColumn) { + this.store.commit('changeSortCondition'); + } }); } },