diff --git a/examples/routers/page.vue b/examples/routers/page.vue index 3c9dda1..f43ccea 100644 --- a/examples/routers/page.vue +++ b/examples/routers/page.vue @@ -1,8 +1,20 @@ diff --git a/src/components/page/page.vue b/src/components/page/page.vue index 6c6ef4a..a2fd855 100644 --- a/src/components/page/page.vue +++ b/src/components/page/page.vue @@ -135,6 +135,12 @@ }; }, watch: { + total (val) { + let maxPage = Math.ceil(val / this.currentPageSize); + if (maxPage < this.currentPage && maxPage > 0) { + this.currentPage = maxPage; + } + }, current (val) { this.currentPage = val; }, -- libgit2 0.21.4