mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-01-25 02:58:43 +08:00
fix(table component): reduce 'insertTableDataRecord' code logic (#1536)
This commit is contained in:
parent
1dc6faf3e6
commit
de8ea59177
@ -196,11 +196,10 @@ export function useDataSource(
|
||||
}
|
||||
|
||||
function insertTableDataRecord(record: Recordable, index: number): Recordable | undefined {
|
||||
if (!dataSourceRef.value || dataSourceRef.value.length == 0) return;
|
||||
// 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) {
|
||||
|
Loading…
Reference in New Issue
Block a user