fix(table): add type annotations for records in useTable hook

This commit is contained in:
Soybean 2025-07-19 02:28:05 +08:00
parent abaaa4a068
commit 32b8f99071

View File

@ -43,7 +43,7 @@ export function useTable<A extends NaiveUI.TableApiFn>(config: NaiveUI.NaiveTabl
// Ensure that the size is greater than 0, If it is less than 0, it will cause paging calculation errors.
const pageSize = size <= 0 ? 10 : size;
const recordsWithIndex = records.map((item, index) => {
const recordsWithIndex = records.map((item: GetTableData<A>, index: number) => {
return {
...item,
index: (current - 1) * pageSize + index + 1