feat(core): getNode未指定页面片容器id时取获得到的第一个

This commit is contained in:
roymondchen 2025-11-24 13:54:09 +08:00
parent 82df2a8f5c
commit 5dbe1fb655

View File

@ -106,6 +106,14 @@ class Page extends Node {
return iteratorContainer?.getNode(id, iteratorIndex[iteratorIndex.length - 1]) as T;
}
if (this.app.pageFragments.size) {
for (const [, pageFragment] of this.app.pageFragments) {
if (pageFragment.nodes.has(id)) {
return pageFragment.nodes.get(id) as T;
}
}
}
}
public setNode(id: Id, node: TMagicNode) {