Pagination: input max value won't be less than 1 (#13727)

Pagination: input max value won't be less than 1 (#13727)
pull/13930/head
Harlan 2018-12-29 13:27:05 +08:00 committed by GitHub
commit 4f93968db4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -345,9 +345,9 @@ export default {
computed: { computed: {
internalPageCount() { internalPageCount() {
if (typeof this.total === 'number') { 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') { } else if (typeof this.pageCount === 'number') {
return this.pageCount; return Math.max(1, this.pageCount);
} }
return null; return null;
} }