vue+elementUI项目开发时分页删除最后一页没有跳转回上一页
删除时重新计算剩余分页数据
const totalPage = Math.ceil((this.total -1 ) / this.params.pageSize) // 总页数
this.params.pageNum = this.params.pageNum > totalPage ? totalPage : this.params.pageNum
this.params.pageNum = this.params.pageNum < 1 ? 1 : this.params.pageNum
批量删除
const totalPage = Math.ceil((this.total - this.multipleSelection.length) / this.pageSize) // 剩余数据总页数
this.params.pageNum = this.params.pageNum > totalPage ? totalPage : this.params.pageNum
this.params.pageNum = this.params.pageNum < 1 ? 1 : this.params.pageNum
// this.multipleSelection 是批量删除的数组