fix: props.getNode 防死循环

This commit is contained in:
林熠 2020-07-26 14:56:57 +08:00
parent d95da04eff
commit 444e25cf24

View File

@ -336,9 +336,14 @@ export class Props implements IPropParent {
*/
getNode() {
const nodeForVision = this.owner;
nodeForVision.getChildren = () => {
return this.owner?.getChildren()?.getChildrenArray() || [];
};
// 判断是否已经是 nodeForVision
if (!nodeForVision.isVisionNode) {
const children = nodeForVision.getChildren();
nodeForVision.getChildren = () => {
return children?.getChildrenArray() || [];
};
nodeForVision.isVisionNode = true;
}
return nodeForVision;
}
}