Skip to content

Commit

Permalink
feat: add isGroup & items to shell SettingPropEntry
Browse files Browse the repository at this point in the history
  • Loading branch information
zyy7259 authored and LeoYuan committed Jun 10, 2022
1 parent e809f89 commit dd27cf8
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion packages/shell/src/setting-prop-entry.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SettingField, ISetValueOptions } from '@alilc/lowcode-designer';
import { CompositeValue, FieldConfig } from '@alilc/lowcode-types';
import { CompositeValue, FieldConfig, CustomView, isCustomView } from '@alilc/lowcode-types';
import { settingPropEntrySymbol } from './symbols';
import Node from './node';
import SettingTopEntry from './setting-top-entry';
Expand All @@ -16,6 +16,13 @@ export default class SettingPropEntry {
return new SettingPropEntry(prop);
}

/**
* 获取设置属性的 isGroup
*/
get isGroup() {
return this[settingPropEntrySymbol].isGroup;
}

/**
* 获取设置属性的 id
*/
Expand Down Expand Up @@ -97,6 +104,18 @@ export default class SettingPropEntry {
return ComponentMeta.create(this[settingPropEntrySymbol].componentMeta);
}

/**
* 获取设置属性的 items
*/
get items(): Array<SettingPropEntry | CustomView> {
return this[settingPropEntrySymbol].items?.map((item) => {
if (isCustomView(item)) {
return item;
}
return item.internalToShellPropEntry();
});
}

/**
* 设置 key 值
* @param key
Expand Down

0 comments on commit dd27cf8

Please sign in to comment.