给el-table添加
:default-sort="{ prop: null, order: null }"
@sort-change="sortChange"
定义对应方法
sortChange(column) {
console.log(column.order);
if (column.order === "ascending") {
this.listPram.sort = "desc";
} else if (column.order === "descending") {
this.listPram.sort = "asc";
} else {
this.listPram.sort = "";
}
this.handlerGetListData(this.listPram);
}
标签:sort,el,排序功能,column,listPram,table,order
From: https://www.cnblogs.com/orangeczs/p/17031707.html