diff --git a/src/pager/index.js b/src/pager/index.js index e986279..fdc0596 100644 --- a/src/pager/index.js +++ b/src/pager/index.js @@ -94,7 +94,7 @@ class Pager extends Component { default: 0, attribute: false, observer(v) { - this.totalpage = Math.ceil(v / this.pagesize) + this.totalpage = Math.ceil(v / this.pagesize) || 1 } }, totalpage: { @@ -102,6 +102,9 @@ class Pager extends Component { default: 1, attribute: false, observer(v) { + if (v < 1) { + v = 1 + } if (this.page > v) { this.page = v }