Skip to content

Commit 32b8f99

Browse files
committed
fix(table): add type annotations for records in useTable hook
1 parent abaaa4a commit 32b8f99

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/hooks/common/table.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export function useTable<A extends NaiveUI.TableApiFn>(config: NaiveUI.NaiveTabl
4343
// Ensure that the size is greater than 0, If it is less than 0, it will cause paging calculation errors.
4444
const pageSize = size <= 0 ? 10 : size;
4545

46-
const recordsWithIndex = records.map((item, index) => {
46+
const recordsWithIndex = records.map((item: GetTableData<A>, index: number) => {
4747
return {
4848
...item,
4949
index: (current - 1) * pageSize + index + 1

0 commit comments

Comments
 (0)