From 9090cee18485ec9a2714ba04605fd211b52eb18d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8B=87?= Date: Tue, 3 Jan 2023 20:13:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20table-datasource=EF=BC=8C=E5=A6=82?= =?UTF-8?q?=E6=9E=9C=E5=90=8E=E7=AB=AF=E8=BF=94=E5=9B=9E=E7=9A=84page=20to?= =?UTF-8?q?tal=E6=98=AF=E5=AD=97=E7=AC=A6=E4=B8=B2=EF=BC=8C=E4=BC=9A?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E9=A1=B5=E7=A0=81=E4=B9=B1=E6=8E=89=20(#2483?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Table/src/hooks/useDataSource.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Table/src/hooks/useDataSource.ts b/src/components/Table/src/hooks/useDataSource.ts index 8b0c400f..6915ec78 100644 --- a/src/components/Table/src/hooks/useDataSource.ts +++ b/src/components/Table/src/hooks/useDataSource.ts @@ -310,7 +310,7 @@ export function useDataSource( const resultTotal: number = isArrayResult ? res.length : get(res, totalField); // 假如数据变少,导致总页数变少并小于当前选中页码,通过getPaginationRef获取到的页码是不正确的,需获取正确的页码再次执行 - if (resultTotal) { + if (Number(resultTotal)) { const currentTotalPage = Math.ceil(resultTotal / pageSize); if (current > currentTotalPage) { setPagination({