Commit 943a4a73e5470ffc7fcdb76dcb160ceaf32df065

Authored by 梁灏
1 parent dde57741

fix #5580 , close #5582

Showing 1 changed file with 4 additions and 2 deletions   Show diff stats
src/components/table/table-head.vue
... ... @@ -171,7 +171,8 @@
171 171 this.$parent.selectAll(status);
172 172 },
173 173 handleSort (index, type) {
174   - const column = this.columns[index];
  174 + // 在固定列时,寻找正确的 index #5580
  175 + const column = this.columns.find(item => item._index === index);
175 176 const _index = column._index;
176 177  
177 178 if (column._sortType === type) {
... ... @@ -180,7 +181,8 @@
180 181 this.$parent.handleSort(_index, type);
181 182 },
182 183 handleSortByHead (index) {
183   - const column = this.columns[index];
  184 + // 在固定列时,寻找正确的 index #5580
  185 + const column = this.columns.find(item => item._index === index);
184 186 if (column.sortable) {
185 187 const type = column._sortType;
186 188 if (type === 'normal') {
... ...