解决分页器选择大于1的页数时,修改数据数量为空时,分页器当前页数不变的问题

This commit is contained in:
guosd 2018-09-06 14:09:01 +08:00
parent f356c49298
commit 405da9a226

View file

@ -156,8 +156,8 @@
watch: {
total (val) {
let maxPage = Math.ceil(val / this.currentPageSize);
if (maxPage < this.currentPage && maxPage > 0) {
this.currentPage = maxPage;
if (maxPage < this.currentPage ) {
this.currentPage = (maxPage === 0 ? 1 : maxPage);
}
},
current (val) {