From 6ca04b1d62d049fb9f5ba4f1dd2e1ea18be0f7e3 Mon Sep 17 00:00:00 2001 From: icssoa <615206459@qq.com> Date: Fri, 17 Oct 2025 23:23:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cool-ui/components/cl-pagination/cl-pagination.uvue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/uni_modules/cool-ui/components/cl-pagination/cl-pagination.uvue b/uni_modules/cool-ui/components/cl-pagination/cl-pagination.uvue index b057423..c82d725 100644 --- a/uni_modules/cool-ui/components/cl-pagination/cl-pagination.uvue +++ b/uni_modules/cool-ui/components/cl-pagination/cl-pagination.uvue @@ -123,7 +123,11 @@ type PassThrough = { const pt = computed(() => parsePt(props.pt)); // 计算总页数,根据总数和每页大小向上取整 -const totalPage = computed(() => Math.ceil(props.total / props.size)); +const totalPage = computed(() => { + if (props.total == 0) return 1; + + return Math.ceil(props.total / props.size); +}); // 绑定值 const value = ref(props.modelValue);