mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-11-29 22:12:11 +08:00
feat(core): getNode未指定页面片容器id时取获得到的第一个
This commit is contained in:
parent
82df2a8f5c
commit
5dbe1fb655
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user