From cd68f91b1dd9b89b2db6be1adc018e250970c197 Mon Sep 17 00:00:00 2001 From: mkno1412222222 <12436341+mkno1412222222@user.noreply.gitee.com> Date: Wed, 3 Sep 2025 08:08:55 +0000 Subject: [PATCH] =?UTF-8?q?update=20ArkUI/entry/src/main/ets/pages/FrameNo?= =?UTF-8?q?deJudgmentNode.ets.=20=E4=B8=AD=E6=96=87=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E8=8B=B1=E6=96=87=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: mkno1412222222 <12436341+mkno1412222222@user.noreply.gitee.com> --- ArkUI/entry/src/main/ets/pages/FrameNodeJudgmentNode.ets | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ArkUI/entry/src/main/ets/pages/FrameNodeJudgmentNode.ets b/ArkUI/entry/src/main/ets/pages/FrameNodeJudgmentNode.ets index 078d078..eca6832 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') !== -- Gitee