From 46e9a205c3de56b00c58cf2c58a83678cf1ec3d9 Mon Sep 17 00:00:00 2001 From: wkj <278599135@.com> Date: Fri, 13 Jun 2025 14:31:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=88=86=E9=A1=B5more?= =?UTF-8?q?=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- es/features/runningTree.js | 7 +++++-- lib/features/runningTree.js | 7 +++++-- src/features/runningTree.ts | 10 ++++++---- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/es/features/runningTree.js b/es/features/runningTree.js index d283aa31..2e674ee6 100644 --- a/es/features/runningTree.js +++ b/es/features/runningTree.js @@ -1025,8 +1025,11 @@ class ListNode extends EntityNode { } if (typeof total === 'number') { this.pagination.total = total; - if (typeof getTotal === 'number' && this.pagination.more && total < getTotal) { - const pages = Math.floor((total - 1) / this.pagination.pageSize) + 1; + } + if (typeof getTotal === 'number') { + const total2 = this.pagination.total || 0; + if (this.pagination.more && total2 < getTotal) { + const pages = Math.floor((total2 - 1) / this.pagination.pageSize) + 1; this.pagination.more = this.pagination.currentPage + 1 < pages; } } diff --git a/lib/features/runningTree.js b/lib/features/runningTree.js index ecff732e..05fdf688 100644 --- a/lib/features/runningTree.js +++ b/lib/features/runningTree.js @@ -1028,8 +1028,11 @@ class ListNode extends EntityNode { } if (typeof total === 'number') { this.pagination.total = total; - if (typeof getTotal === 'number' && this.pagination.more && total < getTotal) { - const pages = Math.floor((total - 1) / this.pagination.pageSize) + 1; + } + if (typeof getTotal === 'number') { + const total2 = this.pagination.total || 0; + if (this.pagination.more && total2 < getTotal) { + const pages = Math.floor((total2 - 1) / this.pagination.pageSize) + 1; this.pagination.more = this.pagination.currentPage + 1 < pages; } } diff --git a/src/features/runningTree.ts b/src/features/runningTree.ts index 674a9bab..06f9b3ae 100644 --- a/src/features/runningTree.ts +++ b/src/features/runningTree.ts @@ -1268,10 +1268,12 @@ class ListNode< } if (typeof total === 'number') { this.pagination.total = total; - - if (typeof getTotal === 'number' && this.pagination.more && total < getTotal) { - const pages = Math.floor((total - 1) / this.pagination.pageSize) + 1; - this.pagination.more = this.pagination.currentPage + 1 < pages + } + if (typeof getTotal === 'number') { + const total2 = this.pagination.total || 0; + if (this.pagination.more && total2 < getTotal) { + const pages = Math.floor((total2 - 1) / this.pagination.pageSize) + 1; + this.pagination.more = this.pagination.currentPage + 1 < pages; } } if (append) {