From 1b9a5da7504365bd5e041e7ba0009200648422f9 Mon Sep 17 00:00:00 2001 From: yutent Date: Wed, 15 Nov 2023 11:22:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=86=E9=A1=B5=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pager/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 }