Merge pull request #4460 from xg-qd/2.0

解决分页器选择大于1的页数时,修改数据数量为空时,分页器当前页数不变的问题
This commit is contained in:
Aresn 2018-09-27 14:30:40 +08:00 committed by GitHub
commit 38a33d4368
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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) {