From 8309e171d48209fbc900da11cff4a4c3607616a6 Mon Sep 17 00:00:00 2001 From: zhangdaiscott Date: Mon, 7 Nov 2022 19:04:24 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90issues/136=E3=80=91=E5=90=8C=E6=AD=A5V?= =?UTF-8?q?ben=EF=BC=9ABasicTable=20=E8=B0=83=E7=94=A8=E6=8F=92=E5=85=A5?= =?UTF-8?q?=E5=87=BD=E6=95=B0=E5=BC=82=E5=B8=B8=E6=8F=92=E5=85=A5=E4=B8=A4?= =?UTF-8?q?=E6=9D=A1=E8=AE=B0=E5=BD=95]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Table/src/hooks/useDataSource.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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;