Commit bb1fee58853c9712e83acbe06cef9efee6b1ba3d
Committed by
GitHub
1 parent
53b2b236
fix: 修复table组件insertTableDataRecord方法的返回类型 (#2490)
Showing
2 changed files
with
2 additions
and
2 deletions
src/components/Table/src/hooks/useDataSource.ts
... | ... | @@ -209,7 +209,7 @@ export function useDataSource( |
209 | 209 | function insertTableDataRecord( |
210 | 210 | record: Recordable | Recordable[], |
211 | 211 | index: number, |
212 | - ): Recordable | undefined { | |
212 | + ): Recordable[] | undefined { | |
213 | 213 | // if (!dataSourceRef.value || dataSourceRef.value.length == 0) return; |
214 | 214 | index = index ?? dataSourceRef.value?.length; |
215 | 215 | const _record = isObject(record) ? [record as Recordable] : (record as Recordable[]); | ... | ... |
src/components/Table/src/types/table.ts
... | ... | @@ -97,7 +97,7 @@ export interface TableActionType { |
97 | 97 | setTableData: <T = Recordable>(values: T[]) => void; |
98 | 98 | updateTableDataRecord: (rowKey: string | number, record: Recordable) => Recordable | void; |
99 | 99 | deleteTableDataRecord: (rowKey: string | number | string[] | number[]) => void; |
100 | - insertTableDataRecord: (record: Recordable | Recordable[], index?: number) => Recordable | void; | |
100 | + insertTableDataRecord: (record: Recordable | Recordable[], index?: number) => Recordable[] | void; | |
101 | 101 | findTableDataRecord: (rowKey: string | number) => Recordable | void; |
102 | 102 | getColumns: (opt?: GetColumnsParams) => BasicColumn[]; |
103 | 103 | setColumns: (columns: BasicColumn[] | string[]) => void; | ... | ... |