mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-02-28 21:20:28 +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);
|
||||
const componentName = item.componentName || prototype.getComponentName()!;
|
||||
const matchedView = this.viewsMap[componentName] || null;
|
||||
if (!prototype.getView() && matchedView) {
|
||||
if (matchedView) {
|
||||
prototype.setView(matchedView);
|
||||
}
|
||||
this.registerPrototype(prototype);
|
||||
|
||||
@ -212,24 +212,30 @@ class Prototype {
|
||||
static addGlobalExtraActions = addGlobalExtraActions;
|
||||
static removeGlobalPropsConfigure = removeGlobalPropsConfigure;
|
||||
static overridePropsConfigure = overridePropsConfigure;
|
||||
static create(config: OldPrototypeConfig | ComponentMetadata | ComponentMeta) {
|
||||
return new Prototype(config);
|
||||
static create(config: OldPrototypeConfig | ComponentMetadata | ComponentMeta, lookup: boolean = false) {
|
||||
return new Prototype(config, lookup);
|
||||
}
|
||||
|
||||
readonly isPrototype = true;
|
||||
readonly meta: ComponentMeta;
|
||||
readonly options: OldPrototypeConfig | ComponentMetadata;
|
||||
|
||||
constructor(input: OldPrototypeConfig | ComponentMetadata | ComponentMeta) {
|
||||
if (isComponentMeta(input)) {
|
||||
this.meta = input;
|
||||
this.options = input.getMetadata();
|
||||
constructor(input: OldPrototypeConfig | ComponentMetadata | ComponentMeta, lookup: boolean = false) {
|
||||
if (lookup) {
|
||||
this.meta = designer.getComponentMeta(input.componentName);
|
||||
this.options = this.meta.getMetadata();
|
||||
return this.meta.prototype || this;
|
||||
} else {
|
||||
this.options = input;
|
||||
const metadata = isNewSpec(input) ? input : upgradeMetadata(input);
|
||||
this.meta = designer.createComponentMeta(metadata);
|
||||
if (isComponentMeta(input)) {
|
||||
this.meta = input;
|
||||
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() {
|
||||
|
||||
@ -24,7 +24,8 @@ export class Trunk {
|
||||
}
|
||||
|
||||
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) {
|
||||
@ -85,7 +86,7 @@ export class Trunk {
|
||||
}
|
||||
|
||||
registerSetter(type: string, setter: CustomView | RegisteredSetter) {
|
||||
console.warn('Trunk.registerSetter is deprecated');
|
||||
// console.warn('Trunk.registerSetter is deprecated');
|
||||
registerSetter(type, setter);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user