【issues/136】同步Vben:BasicTable 调用插入函数异常插入两条记录]

pull/237/head
zhangdaiscott 2022-11-07 19:04:24 +08:00
parent 4da6c77856
commit 8309e171d4
1 changed files with 3 additions and 3 deletions

View File

@ -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】同步VbenBasicTable 调用插入函数异常插入两条记录]
// 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;