mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-06 02:11:56 +00:00
feat: init
This commit is contained in:
parent
1fa525d64a
commit
f509dc6301
@ -115,24 +115,43 @@ export class Editor extends (EventEmitter as any) implements IEditor {
|
||||
remoteComponentDescriptions.map(async (component: any) => {
|
||||
const { exportName, url, npm } = component;
|
||||
await (new AssetLoader()).load(url);
|
||||
if (window[exportName]) {
|
||||
if (Array.isArray(window[exportName])) {
|
||||
(window[exportName] as any).forEach((d: any, i: number) => {
|
||||
function setAssetsComponent(component: any, extraNpmInfo: any = {}) {
|
||||
const components = component.components;
|
||||
if (Array.isArray(components)) {
|
||||
components.forEach(d => {
|
||||
assets.components = assets.components.concat({
|
||||
npm: {
|
||||
...npm,
|
||||
exportName: i.toString(),
|
||||
subName: i.toString(),
|
||||
...extraNpmInfo,
|
||||
},
|
||||
...d.components,
|
||||
...d,
|
||||
} || []);
|
||||
});
|
||||
return;
|
||||
}
|
||||
assets.components = assets.components.concat({
|
||||
npm,
|
||||
...window[exportName].components,
|
||||
npm: {
|
||||
...npm,
|
||||
...extraNpmInfo,
|
||||
},
|
||||
...component.components,
|
||||
} || []);
|
||||
assets.componentList = assets.componentList.concat(window[exportName].componentList || []);
|
||||
// assets.componentList = assets.componentList.concat(component.componentList || []);
|
||||
}
|
||||
function setArrayAssets(value: any[]) {
|
||||
value.forEach((d: any, i: number) => {
|
||||
Array.isArray(d) ? setArrayAssets(d) : setAssetsComponent(d, {
|
||||
exportName: i.toString(),
|
||||
subName: i.toString(),
|
||||
});
|
||||
});
|
||||
}
|
||||
if (window[exportName]) {
|
||||
if (Array.isArray(window[exportName])) {
|
||||
setArrayAssets(window[exportName] as any);
|
||||
} else {
|
||||
setAssetsComponent(window[exportName] as any);
|
||||
}
|
||||
}
|
||||
return window[exportName];
|
||||
}),
|
||||
|
||||
@ -198,7 +198,6 @@ class SettingFieldView extends Component<SettingFieldViewProps, SettingFieldView
|
||||
setterProps = {},
|
||||
setterType,
|
||||
initialValue = null,
|
||||
|
||||
} = this.setterInfo;
|
||||
|
||||
const value = this.value;
|
||||
|
||||
@ -363,6 +363,12 @@ export class Skeleton {
|
||||
...this.parseConfig(config),
|
||||
...extraConfig,
|
||||
};
|
||||
parsedConfig.contentProps = {
|
||||
context: this.editor.get('plugins')?._getLowCodePluginContext({
|
||||
pluginName: 'any',
|
||||
}),
|
||||
...(parsedConfig.contentProps || {}),
|
||||
};
|
||||
let { area } = parsedConfig;
|
||||
if (!area) {
|
||||
if (parsedConfig.type === 'Panel') {
|
||||
|
||||
@ -104,6 +104,7 @@ export default class ComponentMeta {
|
||||
return this[componentMetaSymbol].getMetadata();
|
||||
}
|
||||
|
||||
isComponentMeta = true;
|
||||
/**
|
||||
* check if the current node could be placed in parent node
|
||||
* @param my
|
||||
|
||||
@ -62,7 +62,7 @@ export default class SettingPropEntry {
|
||||
* 获取设置属性的 setter
|
||||
*/
|
||||
get setter() {
|
||||
return this[settingPropEntrySymbol].innerSetters;
|
||||
return this[settingPropEntrySymbol].setter;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user