Merge commit 'ef5dd50bc886aa6c148e310fba4c1cbd415bb47c' into def_releases_2021092316393939_ali-lowcode_ali-lowcode-engine/1.0.69

This commit is contained in:
tbfed 2021-09-30 10:36:17 +08:00
commit d2fa3f53be
2 changed files with 12 additions and 8 deletions

View File

@ -152,10 +152,15 @@ export class Prop implements IPropParent {
if (!this._items) { if (!this._items) {
return this._value; return this._value;
} }
const maps: any = {}; let maps: any;
this.items!.forEach((prop, key) => { this.items!.forEach((prop, key) => {
if (!prop.isUnset()) {
const v = prop.export(stage); const v = prop.export(stage);
maps[prop.key == null ? key : prop.key] = v; if (v != null) {
maps = maps || {};
maps[prop.key || key] = prop.export(stage);
}
}
}); });
return maps; return maps;
} }

View File

@ -129,12 +129,11 @@ export class Props implements IPropParent {
} else { } else {
this.items.forEach(item => { this.items.forEach(item => {
let name = item.key as string; let name = item.key as string;
if (name == null) { if (name == null || item.isUnset() || item.isVirtual()) return;
// todo ...spread
return;
}
let value = item.export(stage); let value = item.export(stage);
if (value != null) {
allProps[name] = value; allProps[name] = value;
}
}); });
// compatible vision // compatible vision
const transformedProps = this.transformToStatic(allProps); const transformedProps = this.transformToStatic(allProps);