From 69319847a0efe6a62be964fb7112d7526ac010da Mon Sep 17 00:00:00 2001 From: cKey <35512826+colinin@users.noreply.github.com> Date: Wed, 1 Feb 2023 14:15:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dtable=E7=BB=84?= =?UTF-8?q?=E4=BB=B6insertTableDataRecord=E6=96=B9=E6=B3=95=E7=9A=84?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/vue/src/components/Table/src/hooks/useDataSource.ts | 2 +- apps/vue/src/components/Table/src/types/table.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/vue/src/components/Table/src/hooks/useDataSource.ts b/apps/vue/src/components/Table/src/hooks/useDataSource.ts index d9d140a78..d4e6bbc78 100644 --- a/apps/vue/src/components/Table/src/hooks/useDataSource.ts +++ b/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[]); diff --git a/apps/vue/src/components/Table/src/types/table.ts b/apps/vue/src/components/Table/src/types/table.ts index 6e5915fab..ca4dbd684 100644 --- a/apps/vue/src/components/Table/src/types/table.ts +++ b/apps/vue/src/components/Table/src/types/table.ts @@ -98,7 +98,7 @@ export interface TableActionType { setTableData: (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;