Skip to content

Commit

Permalink
fix(Pagination): Fix the issue with page being 0
Browse files Browse the repository at this point in the history
  • Loading branch information
wsw2000 committed Nov 25, 2023
1 parent 04d08a4 commit 196f465
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/web-vue/components/pagination/pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,10 @@ export default defineComponent({
computedCurrent.value > 1 &&
computedCurrent.value > curPages
) {
_current.value = curPages;
emit('update:current', curPages);
emit('change', curPages);
const newCurrent = Math.max(curPages, 1);
_current.value = newCurrent;
emit('update:current', newCurrent);
emit('change', newCurrent);
}
});

Expand Down

0 comments on commit 196f465

Please sign in to comment.