Browse Source
fix(table component): reduce 'insertTableDataRecord' code logic (#1536)
pull/1552/head
George Tan
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
3 deletions
-
src/components/Table/src/hooks/useDataSource.ts
|
|
|
@ -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) { |
|
|
|
|