We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c8039a5 commit 46cc375Copy full SHA for 46cc375
src/views/table/complex-table.vue
@@ -35,7 +35,7 @@
35
style="width: 100%;"
36
@sort-change="sortChange"
37
>
38
- <el-table-column label="ID" prop="id" sortable="custom" align="center" width="80">
+ <el-table-column label="ID" prop="id" sortable="custom" align="center" width="80" :class-name="getSortClass('id')">
39
<template slot-scope="scope">
40
<span>{{ scope.row.id }}</span>
41
</template>
@@ -375,6 +375,14 @@ export default {
375
return v[j]
376
}
377
}))
378
+ },
379
+ getSortClass: function(key) {
380
+ const sort = this.listQuery.sort
381
+ return sort === `+${key}`
382
+ ? 'ascending'
383
+ : sort === `-${key}`
384
+ ? 'descending'
385
+ : ''
386
387
388
0 commit comments