title: '数字',
key: "hotCount",
width: 120,
renderHeader: (h, { column, index }) => {
return h(
'span',
[
'数字',
h(
'span',
{
class: 'icon-wrap',
style: {
display: 'inline-block',
width: '12px',
},
on: {
click: () => {
this.toggleSort('up')
}
},
},
[
h(
'i',
{
class: ['iconfont icon-array-up', { isActive: this.isActive['up'] }],
props: {
color: '#C3CBD6',
},
style: {
cursor: 'pointer',
color: this.isActive['up'] ? '#037DF3' : '#C3CBD6',
},
},
)
],
),
h(
'span',
{
class: 'icon-wrap',
on: {
click: () => {
this.toggleSort('down')
}
},
},
[
h(
'i',
{
class: ['iconfont icon-array-down', { isActive: this.isActive['down'] }],
props: {
color: '#C3CBD6',
},
style: {
verticalAlign: 'middle',
cursor: 'pointer',
color: this.isActive['down'] ? '#037DF3' : '#C3CBD6',
},
}
),
]
)
],
)
}
toggleSort(direction) {
if(!['up', 'down'].includes(direction)) {
return
}
this.isActive[direction] = !this.isActive[direction]
this.isActive[direction === 'up' ? 'down' : 'up'] = false
this.handleSort()
},
handleSort() {
this.sort = this.isActive.up ? 0 : (this.isActive.down ? 1 : undefined)
this.updateParams()
},