Skip to content

Commit 7be0bd5

Browse files
cnwhyPanJiaChen
authored andcommitted
fix[complex-table]: form header sort icon is out of sync (#2382)
1 parent 9ff40ab commit 7be0bd5

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/views/table/complex-table.vue

+9-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
style="width: 100%;"
3636
@sort-change="sortChange"
3737
>
38-
<el-table-column :label="$t('table.id')" prop="id" sortable="custom" align="center" width="80">
38+
<el-table-column :label="$t('table.id')" prop="id" sortable="custom" align="center" width="80" :class-name="getSortClass('id')">
3939
<template slot-scope="scope">
4040
<span>{{ scope.row.id }}</span>
4141
</template>
@@ -375,6 +375,14 @@ export default {
375375
return v[j]
376376
}
377377
}))
378+
},
379+
getSortClass: function(key) {
380+
const sort = this.listQuery.sort
381+
return sort === `+${key}`
382+
? 'ascending'
383+
: sort === `-${key}`
384+
? 'descending'
385+
: ''
378386
}
379387
}
380388
}

0 commit comments

Comments
 (0)