diff --git a/src/components/Table/src/hooks/useDataSource.ts b/src/components/Table/src/hooks/useDataSource.ts index ae3867d..4b805ec 100644 --- a/src/components/Table/src/hooks/useDataSource.ts +++ b/src/components/Table/src/hooks/useDataSource.ts @@ -172,11 +172,11 @@ export function useDataSource( } function insertTableDataRecord(record: Recordable, index: number): Recordable | undefined { - if (!dataSourceRef.value || dataSourceRef.value.length == 0) return; + //【issues/136】同步Vben:BasicTable 调用插入函数异常插入两条记录] + // if (!dataSourceRef.value || dataSourceRef.value.length == 0) return; index = index ?? dataSourceRef.value?.length; unref(dataSourceRef).splice(index, 0, record); - unref(propsRef).dataSource?.splice(index, 0, record); - return unref(propsRef).dataSource; + return unref(dataSourceRef); } function findTableDataRecord(rowKey: string | number) { if (!dataSourceRef.value || dataSourceRef.value.length == 0) return;