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