mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-19 14:04:28 +00:00
fix: 部分低代码组件渲染报错
This commit is contained in:
parent
074568ebfb
commit
093015cea2
@ -230,14 +230,14 @@ export class SimulatorRenderer implements BuiltinSimulatorRenderer {
|
|||||||
let result = { ...propsSchema };
|
let result = { ...propsSchema };
|
||||||
const reg = /^(?:this\.props|props)\.(\S+)$/;
|
const reg = /^(?:this\.props|props)\.(\S+)$/;
|
||||||
Object.keys(result).map((key: string) => {
|
Object.keys(result).map((key: string) => {
|
||||||
if (result[key].type === 'JSExpression') {
|
if (result[key]?.type === 'JSExpression') {
|
||||||
const { value } = result[key];
|
const { value } = result[key];
|
||||||
const matched = reg.exec(value);
|
const matched = reg.exec(value);
|
||||||
if (matched) {
|
if (matched) {
|
||||||
const propName = matched[1];
|
const propName = matched[1];
|
||||||
result[key] = propsMap[propName];
|
result[key] = propsMap[propName];
|
||||||
}
|
}
|
||||||
} else if (result[key].type === 'JSSlot') {
|
} else if (result[key]?.type === 'JSSlot') {
|
||||||
const schema = result[key].value;
|
const schema = result[key].value;
|
||||||
result[key] = createElement(Ele, {schema, propsMap: {}});
|
result[key] = createElement(Ele, {schema, propsMap: {}});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user