feat: add componentRenderer lifeCycles log

This commit is contained in:
eternalsky 2023-04-11 20:38:45 +08:00 committed by 林熠
parent c23f16d646
commit 3d470cad69

View File

@ -47,11 +47,25 @@ export default function componentRendererFactory(): IBaseRenderComponent {
return this.__renderComp(Component, this.__renderContextProvider({ compContext: this }));
}
getComponentName() {
return this.props?.componentName;
}
/** 需要重载下面几个方法,如果在低代码组件中绑定了对应的生命周期时会出现死循环 */
componentDidMount() {}
getSnapshotBeforeUpdate() {}
componentDidUpdate() {}
componentWillUnmount() {}
componentDidCatch() {}
componentDidMount() {
this.__debug(`componentDidMount - ${this.getComponentName()}`);
}
getSnapshotBeforeUpdate() {
this.__debug(`getSnapshotBeforeUpdate - ${this.getComponentName()}`);
}
componentDidUpdate() {
this.__debug(`componentDidUpdate - ${this.getComponentName()}`);
}
componentWillUnmount() {
this.__debug(`componentWillUnmount - ${this.getComponentName()}`);
}
componentDidCatch() {
this.__debug(`componentDidCatch - ${this.getComponentName()}`);
}
};
}