删除最后一页最后一个元素的刷新方法:
//02 数据刷新
//记录总页数,
let totalPage = Math.ceil((this.total - 1) / this.pageSize);
console.log(totalPage);
//最后一条数据的 判断处理
if (totalPage === 0 ){
this.findBuild(1,2);
return;
}
// //判断总的页数和当前 页数的关系
// // 如果 currentPage > 总页数 使用 总的页数
let currentPage = this.currentPage > totalPage ? totalPage : this.currentPage
// //最后一页的判断处理
this.currentPage = currentPage < 1 ? 1 : currentPage;
//更新操作
this.findBuild(this.currentPage,this.pageSize);