element.ui table中的自定义升序降序,调后台接口


element.ui table中的自定义升序降序,调接口

页面模块

      
      


 注意:sortable='custom'一定要设置哦,不然就默认elment.ui中的排序了

methods: {
/**
    *  @desc  : 点击排序操作
    *  @date  : 2019/12/3
    *  @update  by ht
    */
    sortChange(column) {
      console.log(column)
      if(column.order ==='ascending' && column.prop ==='createTime'){
        this.orderFiled ='create_time asc'
      }
      if(column.order ==='descending' && column.prop ==='createTime'){
        this.orderFiled ='create_time desc'
      }
      if(column.order ==='ascending' && column.prop ==='updateTime'){
        this.orderFiled ='update_time asc'
      }
      if(column.order ==='descending' && column.prop ==='updateTime'){
        this.orderFiled ='update_time desc'
      }
      this.getList();//向后台传值掉接口
    },
}


你可能感兴趣的:(个人,vue,elemnet)