Skip to content

Commit 622c3e0

Browse files
authored
Merge pull request #3 from PanJiaChen/master
update
2 parents a6c0211 + 46cc375 commit 622c3e0

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="ID" prop="id" sortable="custom" align="center" width="80">
38+
<el-table-column label="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)