让el-table-column具有排序功能

给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);
}
posted @ 2023-01-06 21:59  你笑的好瓜  阅读(376)  评论(0编辑  收藏  举报