elementUI分页删除最后一页数据时跳转回上一页
queryParams: {
current: 1,//当前页数
size: 10,//每页条数
channel: undefined,
},
const totalPage = Math.ceil((this.total -1 ) / this.queryParams.size) // 总页数
this.queryParams.current = this.queryParams.current > totalPage ? totalPage : this.queryParams.current this.queryParams.current = this.queryParams.current < 1 ? 1 : this.queryParams.current
//查询接口
this.getList();
el-table序号递增
<el-table-column type="index" label="序号" align="center">
<template slot-scope="scope">
<span>{{ (queryParams.page - 1) * queryParams.size + scope.$index + 1 }}</span>
</template>
</el-table-column>