Unverified 提交 de8ea591 作者: George Tan 提交者: GitHub

fix(table component): reduce 'insertTableDataRecord' code logic (#1536)

上级 1dc6faf3
...@@ -196,11 +196,10 @@ export function useDataSource( ...@@ -196,11 +196,10 @@ export function useDataSource(
} }
function insertTableDataRecord(record: Recordable, index: number): Recordable | undefined { 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; index = index ?? dataSourceRef.value?.length;
unref(dataSourceRef).splice(index, 0, record); unref(dataSourceRef).splice(index, 0, record);
unref(propsRef).dataSource?.splice(index, 0, record); return unref(dataSourceRef);
return unref(propsRef).dataSource;
} }
function findTableDataRecord(rowKey: string | number) { function findTableDataRecord(rowKey: string | number) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论