Browse Source

fix: 修复table组件insertTableDataRecord方法的返回类型

pull/768/head
cKey 3 years ago
parent
commit
69319847a0
  1. 2
      apps/vue/src/components/Table/src/hooks/useDataSource.ts
  2. 2
      apps/vue/src/components/Table/src/types/table.ts

2
apps/vue/src/components/Table/src/hooks/useDataSource.ts

@ -206,7 +206,7 @@ export function useDataSource(
});
}
function insertTableDataRecord(record: Recordable | Recordable[], index: number): Recordable | undefined {
function insertTableDataRecord(record: Recordable | Recordable[], index: number): 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[]);

2
apps/vue/src/components/Table/src/types/table.ts

@ -98,7 +98,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;

Loading…
Cancel
Save