Runtime API / Interface

RuntimeInstanceGraphNode

Runtime 对父子 Instance 图中一个节点提供的只读快照。

使用说明

instance.children、instance.child(key) 与 instance.publicChild(key) 返回该快照,而不是可直接操作的 FlamoInstance 本体。

const node = panel.child('submit');
if (node) {
console.log(node.instanceId, node.lifecycleState, node.ownership);
const childInstance = runtime.get(node.instanceId);
childInstance?.set({ disabled: true });
}

children 字段保存直接后代的 Instance id。要遍历完整图,可从 runtime.get(id) 继续读取其 children,或使用 Inspector snapshot。不要修改快照字段;父子关系只能通过 composition transaction API 改变。