diff --git a/src/js/pager/index.js b/src/js/pager/index.js index d55a3da..5384b6d 100644 --- a/src/js/pager/index.js +++ b/src/js/pager/index.js @@ -42,10 +42,13 @@ function update(currPage, vm) { totalPage, props: { maxPageShow } } = vm - vm.currPage = vm.inputPage = currPage - if (typeof vm.props.pageChanged === 'function') { - vm.props.pageChanged(currPage) + if (vm.currPage !== currPage) { + vm.currPage = vm.inputPage = currPage + if (typeof vm.props.pageChanged === 'function') { + vm.props.pageChanged(currPage) + } } + vm.pageList.clear() if (totalPage > 1) { vm.pageList.pushArray(calculate({ currPage, totalPage, maxPageShow })) @@ -59,22 +62,22 @@ const tmpls = { :css="{'border-radius': props.radius}" :attr="{disabled: currPage === 1}" :data="{to: parseUrl(1)}" - :click="setPage(1, $event)">`, + :click="go(1, $event)">`, end: ``, + :click="go(totalPage, $event)">`, prev: ``, + :click="go(currPage - 1, $event)">`, next: ``, + :click="go(currPage + 1, $event)">`, pager: ``, + :click="go(el, $event)">`, curr: ``, total: `共 {{totalPage}} 页 {{totalItem}} 条`, jumper: `