解决删除当前页最后一条数据,页面还停留在当前页的问题
成功删除数据后
1 2 3 4 5 6 7 8
| //total:总条数,pageSize:当前每一页的数量 let totalPage = Math.ceil((this.total - 1) / this.pageSize) // 总页数 let currentPage = this.currentPage > totalPage ? totalPage : this.currentPage;//定义需要改变的当前页 this.currentPage = currentPage < 1 ? 1 : currentPage;
//重新请求列表数据 //...
|