mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-10 18:06:02 +00:00
load proto to iframe loopup parent
This commit is contained in:
parent
bb698e7b99
commit
8c3169532e
@ -57,7 +57,7 @@ export default class Bundle {
|
|||||||
this.revisePrototype(item, prototype);
|
this.revisePrototype(item, prototype);
|
||||||
const componentName = item.componentName || prototype.getComponentName()!;
|
const componentName = item.componentName || prototype.getComponentName()!;
|
||||||
const matchedView = this.viewsMap[componentName] || null;
|
const matchedView = this.viewsMap[componentName] || null;
|
||||||
if (!prototype.getView() && matchedView) {
|
if (matchedView) {
|
||||||
prototype.setView(matchedView);
|
prototype.setView(matchedView);
|
||||||
}
|
}
|
||||||
this.registerPrototype(prototype);
|
this.registerPrototype(prototype);
|
||||||
|
|||||||
@ -212,24 +212,30 @@ class Prototype {
|
|||||||
static addGlobalExtraActions = addGlobalExtraActions;
|
static addGlobalExtraActions = addGlobalExtraActions;
|
||||||
static removeGlobalPropsConfigure = removeGlobalPropsConfigure;
|
static removeGlobalPropsConfigure = removeGlobalPropsConfigure;
|
||||||
static overridePropsConfigure = overridePropsConfigure;
|
static overridePropsConfigure = overridePropsConfigure;
|
||||||
static create(config: OldPrototypeConfig | ComponentMetadata | ComponentMeta) {
|
static create(config: OldPrototypeConfig | ComponentMetadata | ComponentMeta, lookup: boolean = false) {
|
||||||
return new Prototype(config);
|
return new Prototype(config, lookup);
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly isPrototype = true;
|
readonly isPrototype = true;
|
||||||
readonly meta: ComponentMeta;
|
readonly meta: ComponentMeta;
|
||||||
readonly options: OldPrototypeConfig | ComponentMetadata;
|
readonly options: OldPrototypeConfig | ComponentMetadata;
|
||||||
|
|
||||||
constructor(input: OldPrototypeConfig | ComponentMetadata | ComponentMeta) {
|
constructor(input: OldPrototypeConfig | ComponentMetadata | ComponentMeta, lookup: boolean = false) {
|
||||||
if (isComponentMeta(input)) {
|
if (lookup) {
|
||||||
this.meta = input;
|
this.meta = designer.getComponentMeta(input.componentName);
|
||||||
this.options = input.getMetadata();
|
this.options = this.meta.getMetadata();
|
||||||
|
return this.meta.prototype || this;
|
||||||
} else {
|
} else {
|
||||||
this.options = input;
|
if (isComponentMeta(input)) {
|
||||||
const metadata = isNewSpec(input) ? input : upgradeMetadata(input);
|
this.meta = input;
|
||||||
this.meta = designer.createComponentMeta(metadata);
|
this.options = input.getMetadata();
|
||||||
|
} else {
|
||||||
|
this.options = input;
|
||||||
|
const metadata = isNewSpec(input) ? input : upgradeMetadata(input);
|
||||||
|
this.meta = designer.createComponentMeta(metadata);
|
||||||
|
}
|
||||||
|
(this.meta as any).prototype = this;
|
||||||
}
|
}
|
||||||
(this.meta as any).prototype = this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getId() {
|
getId() {
|
||||||
|
|||||||
@ -24,7 +24,8 @@ export class Trunk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getList(): any[] {
|
getList(): any[] {
|
||||||
return this.trunk.reduceRight((prev, cur) => prev.concat(cur.getList()), []);
|
const list = this.trunk.reduceRight((prev, cur) => prev.concat(cur.getList()), []);
|
||||||
|
return Array.from(new Set(list));
|
||||||
}
|
}
|
||||||
|
|
||||||
getPrototype(name: string) {
|
getPrototype(name: string) {
|
||||||
@ -85,7 +86,7 @@ export class Trunk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
registerSetter(type: string, setter: CustomView | RegisteredSetter) {
|
registerSetter(type: string, setter: CustomView | RegisteredSetter) {
|
||||||
console.warn('Trunk.registerSetter is deprecated');
|
// console.warn('Trunk.registerSetter is deprecated');
|
||||||
registerSetter(type, setter);
|
registerSetter(type, setter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user