el-table
:data="tableData"
class="y_table"
border
stripe
@sort-change="changeTableSort"
show-summary
sum-text="总和"
style="width: 100%">
<el-table-column
label="用户数"
prop="user_count"
:sortable="'custom'"
>
<template slot-scope="scope">
<span>
{{scope.row.user_count}}
</span>
</template>
</el-table-column>
</el-table>
changeTableSort(column){
console.log(column);
if(column.prop == 'course_title') {
if(column.order == 'ascending') {
this.order_type = 1
} else if(column.order == 'descending') {
this.order_type = 2
} else {
this.order_type = 9
}
}
if(column.prop == 'total_count') {
if(column.order == 'ascending') {
this.order_type = 3
} else if(column.order == 'descending') {
this.order_type = 4
} else {
this.order_type = 9
}
}
if(column.prop == 'valid_count') {
if(column.order == 'ascending') {
this.order_type = 5
} else if(column.order == 'descending') {
this.order_type = 6
} else {
this.order_type = 9
}
}
if(column.prop == 'user_count') {
if(column.order == 'ascending') {
this.order_type = 7
} else if(column.order == 'descending') {
this.order_type = 8
} else {
this.order_type = 9
}
}
this.getData()
},