mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-19 05:48:17 +00:00
Merge commit 'b84d5c8486bb7ccfd6b3e300c29054c97837cd4a' into def_releases_2022040810384040_ali-lowcode_ali-lowcode-engine/1.0.81
This commit is contained in:
commit
b07c066728
@ -498,8 +498,6 @@ export class SimulatorRendererContainer implements BuiltinSimulatorRenderer {
|
|||||||
const _schema: any = {
|
const _schema: any = {
|
||||||
...compatibleLegaoSchema(schema),
|
...compatibleLegaoSchema(schema),
|
||||||
};
|
};
|
||||||
_schema.methods = {};
|
|
||||||
_schema.lifeCycles = {};
|
|
||||||
|
|
||||||
if (schema.componentName === 'Component' && (schema as ComponentSchema).css) {
|
if (schema.componentName === 'Component' && (schema as ComponentSchema).css) {
|
||||||
const doc = window.document;
|
const doc = window.document;
|
||||||
|
|||||||
@ -429,8 +429,6 @@ export class SimulatorRendererContainer implements BuiltinSimulatorRenderer {
|
|||||||
const _schema: any = {
|
const _schema: any = {
|
||||||
...compatibleLegaoSchema(schema),
|
...compatibleLegaoSchema(schema),
|
||||||
};
|
};
|
||||||
_schema.methods = {};
|
|
||||||
_schema.lifeCycles = {};
|
|
||||||
|
|
||||||
if (schema.componentName === 'Component' && (schema as ComponentSchema).css) {
|
if (schema.componentName === 'Component' && (schema as ComponentSchema).css) {
|
||||||
const doc = window.document;
|
const doc = window.document;
|
||||||
|
|||||||
@ -32,6 +32,8 @@ export default function componentRendererFactory() {
|
|||||||
|
|
||||||
const noContainer = this.__parseData(__schema.props?.noContainer);
|
const noContainer = this.__parseData(__schema.props?.noContainer);
|
||||||
|
|
||||||
|
this.__bindCustomMethods();
|
||||||
|
|
||||||
if (noContainer) {
|
if (noContainer) {
|
||||||
return this.__renderContextProvider({ compContext: this });
|
return this.__renderContextProvider({ compContext: this });
|
||||||
}
|
}
|
||||||
@ -44,5 +46,12 @@ export default function componentRendererFactory() {
|
|||||||
|
|
||||||
return this.__renderComp(Component, this.__renderContextProvider({ compContext: this }));
|
return this.__renderComp(Component, this.__renderContextProvider({ compContext: this }));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 需要重载下面几个方法,如果在低代码组件中绑定了对应的生命周期时会出现死循环 */
|
||||||
|
componentDidMount() {}
|
||||||
|
getSnapshotBeforeUpdate() {}
|
||||||
|
componentDidUpdate() {}
|
||||||
|
componentWillUnmount() {}
|
||||||
|
componentDidCatch() {}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,15 @@ import { isJSBlock, isJSSlot, ActivityType, NodeSchema, PageSchema, RootSchema }
|
|||||||
import { isVariable } from './misc';
|
import { isVariable } from './misc';
|
||||||
import { isPlainObject } from './is-plain-object';
|
import { isPlainObject } from './is-plain-object';
|
||||||
|
|
||||||
|
function isJsObject(props: any) {
|
||||||
|
if (typeof props === 'object' && props !== null) {
|
||||||
|
return props.type && props.source && props.compiled;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function isActionRef(props: any): boolean {
|
||||||
|
return props.type && props.type === 'actionRef';
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 将「乐高版本」协议升级成 JSExpression / JSSlot 等标准协议的结构
|
* 将「乐高版本」协议升级成 JSExpression / JSSlot 等标准协议的结构
|
||||||
* @param props
|
* @param props
|
||||||
@ -40,6 +49,19 @@ export function compatibleLegaoSchema(props: any): any {
|
|||||||
mock: props.value,
|
mock: props.value,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
if (isJsObject(props)) {
|
||||||
|
return {
|
||||||
|
type: 'JSExpression',
|
||||||
|
value: props.compiled,
|
||||||
|
extType: 'function',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
if (isActionRef(props)) {
|
||||||
|
return {
|
||||||
|
type: 'JSExpression',
|
||||||
|
value: `${props.id}.bind(this)`,
|
||||||
|
};
|
||||||
|
}
|
||||||
const newProps: any = {};
|
const newProps: any = {};
|
||||||
Object.keys(props).forEach((key) => {
|
Object.keys(props).forEach((key) => {
|
||||||
if (/^__slot__/.test(key) && props[key] === true) {
|
if (/^__slot__/.test(key) && props[key] === true) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user