Skip to content

Commit

Permalink
fix: 在开启懒加载的情况下,首次 insert row -1 会导致重复添加 x-extends#2320
Browse files Browse the repository at this point in the history
  • Loading branch information
Clover-You committed Mar 8, 2024
1 parent 365c737 commit f71e40e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/edit/src/hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ const editHook: VxeGlobalHooksHandles.HookOptions = {
mapChilds = parentRow[childrenField] = []
}
parentChilds[funcName](item)
mapChilds[funcName](item)
// 在开启懒加载的情况下,首次 insert row 会导致重复添加
if (mapChilds !== parentChilds) {
mapChilds[funcName](item)
}
const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, items: parentChilds, parent: parentRow, level: parentLevel + 1 }
fullDataRowIdData[rowid] = rest
fullAllDataRowIdData[rowid] = rest
Expand Down

0 comments on commit f71e40e

Please sign in to comment.