mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-12 19:25:48 +00:00
fix(prop): fix prop.export can not correctly export undefined[]
This commit is contained in:
parent
82cdafe07e
commit
dff06e70ac
@ -336,13 +336,9 @@ export class Prop implements IProp, IPropParent {
|
||||
if (!this._items) {
|
||||
return this._value;
|
||||
}
|
||||
const values = this.items!.map((prop) => {
|
||||
return this.items!.map((prop) => {
|
||||
return prop?.export(stage);
|
||||
});
|
||||
if (values.every((val) => val === undefined)) {
|
||||
return undefined;
|
||||
}
|
||||
return values;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -435,7 +435,7 @@ describe('Prop 类测试', () => {
|
||||
|
||||
it('should return undefined when all items are undefined', () => {
|
||||
prop = new Prop(mockPropsInst, [undefined, undefined], '___loopArgs___');
|
||||
expect(prop.getValue()).toBeUndefined();
|
||||
expect(prop.getValue()).toEqual([undefined, undefined]);
|
||||
});
|
||||
|
||||
it('迭代器 / map / forEach', () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user