diff --git a/ArkUI/entry/src/main/ets/pages/FrameNodeJudgmentNode.ets b/ArkUI/entry/src/main/ets/pages/FrameNodeJudgmentNode.ets index 078d078ee96b70b0d62fd39300a16a4bc924efd7..eca6832d9758fdf55861faef756b623de5818b56 100644 --- a/ArkUI/entry/src/main/ets/pages/FrameNodeJudgmentNode.ets +++ b/ArkUI/entry/src/main/ets/pages/FrameNodeJudgmentNode.ets @@ -28,10 +28,10 @@ class MyNodeController extends NodeController { makeNode(uiContext: UIContext): FrameNode | null { this.rootNode = new FrameNode(uiContext); this.node1 = new FrameNode(uiContext); - this.node1.commonAttribute.id('node1'); // 设置id + this.node1.commonAttribute.id('node1'); // Set id this.node2 = new FrameNode(uiContext); - this.node2.commonAttribute.id('node2'); // 设置id - this.rootNode.appendChild(this.node1); // node1在主树上,node2不在主树上 + this.node2.commonAttribute.id('node2'); // Set id + this.rootNode.appendChild(this.node1); // Node1 is on the main tree,node2 is not on the main tree return this.rootNode; } } @@ -46,7 +46,7 @@ struct Index { NodeContainer(this.myNodeController) Button('Click') .onClick(() => { - // 如果通过getAttachedFrameNodeById获取不到节点,则说明节点没有被挂载到主树上 + // If the node cannot be obtained through getAttachedFrameNodeById, it indicates that the node has not been mounted to the main tree. console.info(`node1 is attached to main tree: ${(this.getUIContext().getAttachedFrameNodeById('node1') !== null)}`); console.info(`node2 is attached to main tree: ${(this.getUIContext().getAttachedFrameNodeById('node2') !==