element el-table 表格远程后台排序sort-change

<el-table ref="nana" @sort-change='tableChange' v-cloak id="myTable" height="100%" :data="pageDate" style="width:100%;height:100%" :default-sort="{prop: 'date', order: 'descending'}">

       <el-table-column prop="typeId" label="商品价格" sortable='custom' width='130px'>

      </el-table-column>

</el-table>

这里@sort-change='tableChange'与sortable='custom' 必须同时设置。注册tableChange事件传column,prop,order参数即可获取不同的值,然后传参数即可

tableChange:function(column,prop,order){

  console.log(column)

  console.log(prop)

  console.log(order)

},

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容