@tmagic/editor 1.3.0-alpha.15 → 1.3.0-alpha.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7785,12 +7785,14 @@ class Watcher extends EventEmitter {
7785
7785
  * @param nodes 需要清除依赖的节点
7786
7786
  */
7787
7787
  clear(nodes) {
7788
+ const clearedItemsNodeIds = [];
7788
7789
  Object.values(this.targets).forEach((targets) => {
7789
7790
  Object.values(targets).forEach((target) => {
7790
7791
  if (nodes) {
7791
7792
  nodes.forEach((node) => {
7792
7793
  target.removeDep(node);
7793
- if (Array.isArray(node.items)) {
7794
+ if (Array.isArray(node.items) && node.items.length && !clearedItemsNodeIds.includes(node.id)) {
7795
+ clearedItemsNodeIds.push(node.id);
7794
7796
  this.clear(node.items);
7795
7797
  }
7796
7798
  });