diff --git a/src/js/anot.shim.js b/src/js/anot.shim.js index 554f4af..194a5ac 100644 --- a/src/js/anot.shim.js +++ b/src/js/anot.shim.js @@ -3435,15 +3435,13 @@ var componentQueue = [] var widgetList = [] var componentHooks = { - construct: function(props, state, next) { - next(props, state) - }, + construct: noop, componentWillMount: noop, componentDidMount: noop, childComponentDidMount: noop, componentWillUnmount: noop, - render: function(str) { - return str + render: function() { + return null } } diff --git a/src/js/pages/index.js b/src/js/pages/index.js index 9483ae5..dc952a0 100644 --- a/src/js/pages/index.js +++ b/src/js/pages/index.js @@ -37,16 +37,13 @@ function calculate({ currPage, maxPageShow, totalPages }) { } // 更新组件 function update(currPage, vm) { - const { totalPages, props } = vm + const { totalPages, props: { maxPageShow } } = vm vm.currPage = vm.inputPage = currPage vm.props.onPageChange.call(null, currPage) - if (totalPages < 2) { - return - } vm.pageList.clear() - vm.pageList.pushArray( - calculate({ currPage, totalPages, maxPageShow: props.maxPageShow }) - ) + if (totalPages > 1) { + vm.pageList.pushArray(calculate({ currPage, totalPages, maxPageShow })) + } } export default Anot.component('pages', { @@ -84,7 +81,7 @@ export default Anot.component('pages', { :attr="{href: parseUrl(totalPages)}" :click="setPage(totalPages, $event)">{{props.btns.end}} -