mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-12 19:52:51 +00:00
feat: low-code components support lifecycle and function execution
This commit is contained in:
parent
3d176cb534
commit
176583f48a
@ -501,8 +501,6 @@ export class SimulatorRendererContainer implements BuiltinSimulatorRenderer {
|
||||
const _schema: any = {
|
||||
...compatibleLegaoSchema(schema),
|
||||
};
|
||||
_schema.methods = {};
|
||||
_schema.lifeCycles = {};
|
||||
|
||||
if (schema.componentName === 'Component' && (schema as ComponentSchema).css) {
|
||||
const doc = window.document;
|
||||
|
||||
@ -428,8 +428,6 @@ export class SimulatorRendererContainer implements BuiltinSimulatorRenderer {
|
||||
const _schema: any = {
|
||||
...compatibleLegaoSchema(schema),
|
||||
};
|
||||
_schema.methods = {};
|
||||
_schema.lifeCycles = {};
|
||||
|
||||
if (schema.componentName === 'Component' && (schema as ComponentSchema).css) {
|
||||
const doc = window.document;
|
||||
|
||||
@ -32,6 +32,8 @@ export default function componentRendererFactory(): IBaseRenderComponent {
|
||||
|
||||
const noContainer = this.__parseData(__schema.props?.noContainer);
|
||||
|
||||
this.__bindCustomMethods(this.props);
|
||||
|
||||
if (noContainer) {
|
||||
return this.__renderContextProvider({ compContext: this });
|
||||
}
|
||||
@ -44,5 +46,12 @@ export default function componentRendererFactory(): IBaseRenderComponent {
|
||||
|
||||
return this.__renderComp(Component, this.__renderContextProvider({ compContext: this }));
|
||||
}
|
||||
|
||||
/** 需要重载下面几个方法,如果在低代码组件中绑定了对应的生命周期时会出现死循环 */
|
||||
componentDidMount() {}
|
||||
getSnapshotBeforeUpdate() {}
|
||||
componentDidUpdate() {}
|
||||
componentWillUnmount() {}
|
||||
componentDidCatch() {}
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user