mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-09-18 01:36:37 +08:00
fix(table): add type annotations for records in useTable hook
This commit is contained in:
parent
abaaa4a068
commit
32b8f99071
@ -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.
|
// 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 pageSize = size <= 0 ? 10 : size;
|
||||||
|
|
||||||
const recordsWithIndex = records.map((item, index) => {
|
const recordsWithIndex = records.map((item: GetTableData<A>, index: number) => {
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
index: (current - 1) * pageSize + index + 1
|
index: (current - 1) * pageSize + index + 1
|
||||||
|
Loading…
Reference in New Issue
Block a user