fix(table): 修复分页数据处理逻辑

- 修复 pageSize 赋值前增加空值检查,避免引起数据二次查询
- 修正分页参数解构顺序,避免数据错乱
This commit is contained in:
tangzc
2025-12-07 01:39:11 +08:00
parent bfb7169e73
commit a59fdc58b0
+4 -2
View File
@@ -131,7 +131,9 @@ export function useNaivePaginatedTable<ResponseData, ApiData>(
getColumns,
onFetched: data => {
pagination.itemCount = data.total;
pagination.pageSize = data.pageSize;
if (data.pageSize) {
pagination.pageSize = data.pageSize;
}
}
});
@@ -252,7 +254,7 @@ export function defaultTransform<ApiData>(
};
}
const { rows: records, pageSize: current, pageNum: size, total } = data;
const { rows: records, pageSize: size, pageNum: current, total } = data;
return {
data: records,