From 929141be968721e87eb032c2719bdc34afa40d44 Mon Sep 17 00:00:00 2001 From: lqxlearn <979252490@qq.com> Date: Tue, 18 Jan 2022 21:48:05 +0800 Subject: [PATCH] fix:fetch-success total 0 (#1597) Co-authored-by: qiuxiang --- 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 698b199a..7d6c00af 100644 --- a/src/components/Table/src/hooks/useDataSource.ts +++ b/src/components/Table/src/hooks/useDataSource.ts @@ -292,7 +292,7 @@ export function useDataSource( const isArrayResult = Array.isArray(res); let resultItems: Recordable[] = isArrayResult ? res : get(res, listField); - const resultTotal: number = isArrayResult ? 0 : get(res, totalField); + const resultTotal: number = isArrayResult ? res.length : get(res, totalField); // 假如数据变少,导致总页数变少并小于当前选中页码,通过getPaginationRef获取到的页码是不正确的,需获取正确的页码再次执行 if (resultTotal) { -- GitLab