From 82fbac875d82a35d8f5f5f3c39a0324b16d8a044 Mon Sep 17 00:00:00 2001 From: HarlanLuo Date: Wed, 12 Dec 2018 21:10:43 +0800 Subject: [PATCH] Pagination: input max value won't be less than 1 (#13727) --- packages/pagination/src/pagination.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/pagination/src/pagination.js b/packages/pagination/src/pagination.js index 86e6e898d..83b8bb313 100644 --- a/packages/pagination/src/pagination.js +++ b/packages/pagination/src/pagination.js @@ -345,9 +345,9 @@ export default { computed: { internalPageCount() { if (typeof this.total === 'number') { - return Math.ceil(this.total / this.internalPageSize); + return Math.max(1, Math.ceil(this.total / this.internalPageSize)); } else if (typeof this.pageCount === 'number') { - return this.pageCount; + return Math.max(1, this.pageCount); } return null; }