Commit 405da9a226f2b9783d365434242a5e299cf92d68
1 parent
f356c492
解决分页器选择大于1的页数时,修改数据数量为空时,分页器当前页数不变的问题
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
src/components/page/page.vue
... | ... | @@ -156,8 +156,8 @@ |
156 | 156 | watch: { |
157 | 157 | total (val) { |
158 | 158 | let maxPage = Math.ceil(val / this.currentPageSize); |
159 | - if (maxPage < this.currentPage && maxPage > 0) { | |
160 | - this.currentPage = maxPage; | |
159 | + if (maxPage < this.currentPage ) { | |
160 | + this.currentPage = (maxPage === 0 ? 1 : maxPage); | |
161 | 161 | } |
162 | 162 | }, |
163 | 163 | current (val) { | ... | ... |