From 943a4a73e5470ffc7fcdb76dcb160ceaf32df065 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E7=81=8F?= Date: Tue, 9 Apr 2019 14:46:25 +0800 Subject: [PATCH] fix #5580 , close #5582 --- src/components/table/table-head.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/table/table-head.vue b/src/components/table/table-head.vue index 006e9b14..e1b2a664 100644 --- a/src/components/table/table-head.vue +++ b/src/components/table/table-head.vue @@ -171,7 +171,8 @@ this.$parent.selectAll(status); }, handleSort (index, type) { - const column = this.columns[index]; + // 在固定列时,寻找正确的 index #5580 + const column = this.columns.find(item => item._index === index); const _index = column._index; if (column._sortType === type) { @@ -180,7 +181,8 @@ this.$parent.handleSort(_index, type); }, handleSortByHead (index) { - const column = this.columns[index]; + // 在固定列时,寻找正确的 index #5580 + const column = this.columns.find(item => item._index === index); if (column.sortable) { const type = column._sortType; if (type === 'normal') {