Commit 38a33d43689ed385108991d0b77f6114c00c811d
Committed by
GitHub

Merge pull request #4460 from xg-qd/2.0
解决分页器选择大于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) { | ... | ... |