在java中
@RequestParam(value="prop", required=false) String prop,
@RequestParam(value="sort", required=false) String sort,
/*排序*/
String sortStr="";
if ((prop!=""&&prop!=null)&&(sort!=""&&sort!=null)){
sortStr="order by"+" "+prop+" "+sort;
}else {
sortStr="order by id DESC";
}
vue中
/*排序*/
<el-table-column label="金额" width="180px" align="center" sortable="custom" prop="withdraw_count">
<template slot-scope="scope">
<span>{{ scope.row.withdrawCount }}</span>
</template>
</el-table-column>
sortChange:function(column,prop,order){
/* console.log(column)
console.log(prop)
console.log(order)*/
if (column.order=="descending"){
this.uwInfo.sort="DESC"
this.uwInfo.prop=column.prop
}else if (column.order=="ascending") {
this.uwInfo.sort="ASC"
this.uwInfo.prop=column.prop
}
this.getList()
},