fix: table-datasource,如果后端返回的page total是字符串,会导致页码乱掉 (#2483)

1个文件已修改
2 ■■■ 已修改文件
src/components/Table/src/hooks/useDataSource.ts 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Table/src/hooks/useDataSource.ts
@@ -310,7 +310,7 @@
      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({