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);