fix: 修复table组件insertTableDataRecord方法的返回类型 (#2490)

This commit is contained in:
前端爱码士
2023-01-18 11:16:04 +08:00
committed by GitHub
parent 53b2b23620
commit bb1fee5885
2 changed files with 2 additions and 2 deletions

View File

@@ -209,7 +209,7 @@ export function useDataSource(
function insertTableDataRecord(
record: Recordable | Recordable[],
index: number,
): Recordable | undefined {
): Recordable[] | undefined {
// if (!dataSourceRef.value || dataSourceRef.value.length == 0) return;
index = index ?? dataSourceRef.value?.length;
const _record = isObject(record) ? [record as Recordable] : (record as Recordable[]);

View File

@@ -97,7 +97,7 @@ export interface TableActionType {
setTableData: <T = Recordable>(values: T[]) => void;
updateTableDataRecord: (rowKey: string | number, record: Recordable) => Recordable | 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;
getColumns: (opt?: GetColumnsParams) => BasicColumn[];
setColumns: (columns: BasicColumn[] | string[]) => void;