Merge branch 'fix/prop-init' into 'release/0.9.0'

Fix/prop init



See merge request !904709
This commit is contained in:
康为 2020-07-23 12:09:15 +08:00
commit 6ca5253730
2 changed files with 6 additions and 4 deletions

View File

@ -66,7 +66,7 @@ export class Prop implements IPropParent {
const type = this._type;
if (type === 'unset') {
return UNSET;
return undefined;
}
if (type === 'literal' || type === 'expression') {
@ -98,9 +98,7 @@ export class Prop implements IPropParent {
const maps: any = {};
this.items!.forEach((prop, key) => {
const v = prop.export(stage);
if (v !== UNSET) {
maps[prop.key == null ? key : prop.key] = v;
}
maps[prop.key == null ? key : prop.key] = v;
});
return maps;
}

View File

@ -120,7 +120,11 @@ designer.addPropsReducer((props, node) => {
newProps[item.name] = props[item.name];
}
}
if (newProps[item.name] && !node.props.has(item.name)) {
node.props.add(newProps[item.name], item.name);
}
});
return newProps;
}
return props;