前端爱码士
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
2 additions and
2 deletions
-
src/components/Table/src/hooks/useDataSource.ts
-
src/components/Table/src/types/table.ts
|
|
@ -209,7 +209,7 @@ export function useDataSource( |
|
|
function insertTableDataRecord( |
|
|
function insertTableDataRecord( |
|
|
record: Recordable | Recordable[], |
|
|
record: Recordable | Recordable[], |
|
|
index: number, |
|
|
index: number, |
|
|
): Recordable | undefined { |
|
|
): Recordable[] | undefined { |
|
|
// if (!dataSourceRef.value || dataSourceRef.value.length == 0) return;
|
|
|
// if (!dataSourceRef.value || dataSourceRef.value.length == 0) return;
|
|
|
index = index ?? dataSourceRef.value?.length; |
|
|
index = index ?? dataSourceRef.value?.length; |
|
|
const _record = isObject(record) ? [record as Recordable] : (record as Recordable[]); |
|
|
const _record = isObject(record) ? [record as Recordable] : (record as Recordable[]); |
|
|
|
|
|
@ -97,7 +97,7 @@ export interface TableActionType { |
|
|
setTableData: <T = Recordable>(values: T[]) => void; |
|
|
setTableData: <T = Recordable>(values: T[]) => void; |
|
|
updateTableDataRecord: (rowKey: string | number, record: Recordable) => Recordable | void; |
|
|
updateTableDataRecord: (rowKey: string | number, record: Recordable) => Recordable | void; |
|
|
deleteTableDataRecord: (rowKey: string | number | string[] | number[]) => void; |
|
|
deleteTableDataRecord: (rowKey: string | number | string[] | number[]) => void; |
|
|
insertTableDataRecord: (record: Recordable | Recordable[], index?: number) => Recordable | void; |
|
|
insertTableDataRecord: (record: Recordable | Recordable[], index?: number) => Recordable[] | void; |
|
|
findTableDataRecord: (rowKey: string | number) => Recordable | void; |
|
|
findTableDataRecord: (rowKey: string | number) => Recordable | void; |
|
|
getColumns: (opt?: GetColumnsParams) => BasicColumn[]; |
|
|
getColumns: (opt?: GetColumnsParams) => BasicColumn[]; |
|
|
setColumns: (columns: BasicColumn[] | string[]) => void; |
|
|
setColumns: (columns: BasicColumn[] | string[]) => void; |
|
|
|