if (res && res.data && res.data.success) {
this.$message.success("数据删除成功");
let newPageing = Math.ceil((this.total - 1) / this.pageSize);//Math.ceil向上取整算出新的分页
let currentPage = this.pageNum > newPageing ? newPageing : this.pageNum;//计算当前页应该是哪页
this.pageNum = currentPage < 1 ? 1 : currentPage;//把当前页的值赋给this.page,重新渲染列表
this.searchListData()
} else {
this.$message.error('删除失败');
}
vue 列表分页 删除完当前页面数据 分页无法自动跳转到上一页刷新数据问题
最新推荐文章于 2024-09-05 23:39:52 发布