element el-table 添加分页连接的序号,清除sortable排序,解决删除最后一项时分页出现问题


先看代码:

                                        {{scope.$index+(currentPage - 1) *size + 1}}                                                     

1.序号

{{scope.$index+(currentPage - 1) *size + 1}}

2.清除排序

 this.$refs.dateSort.columnConfig.order = '';

3.解决删除最后一项时分页出现问题(数据为空)

思路:当页面总条数 = (当前页数-1)*当前页条数,currentPage减1,重新获取列表;

watch:{ total(){
if(this.total==(this.currentPage-1)*this.size&& this.total!=0){ this.currentPage-=1; this.getTableData();//获取列表数据 } } }
vue