mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-12 17:08:14 +00:00
fix: 兼容原来 PropStash 的 export 数据结构, 去除 undefined 等值
This commit is contained in:
parent
621e66dca2
commit
ef5dd50bc8
@ -152,10 +152,15 @@ export class Prop implements IPropParent {
|
||||
if (!this._items) {
|
||||
return this._value;
|
||||
}
|
||||
const maps: any = {};
|
||||
let maps: any;
|
||||
this.items!.forEach((prop, key) => {
|
||||
const v = prop.export(stage);
|
||||
maps[prop.key == null ? key : prop.key] = v;
|
||||
if (!prop.isUnset()) {
|
||||
const v = prop.export(stage);
|
||||
if (v != null) {
|
||||
maps = maps || {};
|
||||
maps[prop.key || key] = prop.export(stage);
|
||||
}
|
||||
}
|
||||
});
|
||||
return maps;
|
||||
}
|
||||
|
||||
@ -129,12 +129,11 @@ export class Props implements IPropParent {
|
||||
} else {
|
||||
this.items.forEach(item => {
|
||||
let name = item.key as string;
|
||||
if (name == null) {
|
||||
// todo ...spread
|
||||
return;
|
||||
}
|
||||
if (name == null || item.isUnset() || item.isVirtual()) return;
|
||||
let value = item.export(stage);
|
||||
allProps[name] = value;
|
||||
if (value != null) {
|
||||
allProps[name] = value;
|
||||
}
|
||||
});
|
||||
// compatible vision
|
||||
const transformedProps = this.transformToStatic(allProps);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user