首页 > 其他分享 >让el-table-column具有排序功能

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

时间:2023-01-06 22:12:27浏览次数:42  
标签:sort el 排序功能 column listPram table order

给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

相关文章