mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-02-28 04:40:32 +00:00
fix: settingField items is empty when type is not 'group'
This commit is contained in:
parent
760e6a6226
commit
582c41a121
@ -51,10 +51,15 @@ export class SettingField extends SettingPropEntry implements SettingEntry {
|
||||
this._expanded = extraProps?.defaultCollapsed ? false : true;
|
||||
|
||||
// initial items
|
||||
if (this.type === 'group' && items) {
|
||||
if (items && items.length > 0) {
|
||||
this.initItems(items, settingFieldCollector);
|
||||
} else if (settingFieldCollector && config.name) {
|
||||
settingFieldCollector(config.name, this);
|
||||
}
|
||||
if (settingFieldCollector && config.name) {
|
||||
if (parent && parent instanceof SettingField && parent.type !== 'group') {
|
||||
settingFieldCollector((parent as SettingField).name + '.' + config.name, this);
|
||||
} else {
|
||||
settingFieldCollector(config.name, this);
|
||||
}
|
||||
}
|
||||
|
||||
// compatiable old config
|
||||
|
||||
@ -268,8 +268,9 @@ export function upgradePropConfig(config: OldPropConfig, collector: ConfigCollec
|
||||
extraProps.condition = (field: Field) => !(isHidden(field) || isDisabled(field));
|
||||
}
|
||||
|
||||
newConfig.items = items ? upgradeConfigure(items, collector) : [];
|
||||
|
||||
if (type === 'group') {
|
||||
newConfig.items = items ? upgradeConfigure(items, collector) : [];
|
||||
return newConfig;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user