mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-12 11:20:11 +00:00
fix:修改config.onGot 和 editor.onGot 方法与文档不一致的问题
This commit is contained in:
parent
33a4192e2c
commit
65a040390f
@ -288,13 +288,11 @@ export class EngineConfig implements IEngineConfig {
|
|||||||
const val = this.config?.[key];
|
const val = this.config?.[key];
|
||||||
if (val !== undefined) {
|
if (val !== undefined) {
|
||||||
fn(val);
|
fn(val);
|
||||||
return () => {};
|
|
||||||
} else {
|
|
||||||
this.setWait(key, fn);
|
|
||||||
return () => {
|
|
||||||
this.delWait(key, fn);
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
this.setWait(key, fn);
|
||||||
|
return () => {
|
||||||
|
this.delWait(key, fn);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
notifyGot(key: string): void {
|
notifyGot(key: string): void {
|
||||||
|
|||||||
@ -190,13 +190,11 @@ export class Editor extends (EventEmitter as any) implements IPublicModelEditor
|
|||||||
const x = this.context.get(keyOrType);
|
const x = this.context.get(keyOrType);
|
||||||
if (x !== undefined) {
|
if (x !== undefined) {
|
||||||
fn(x);
|
fn(x);
|
||||||
return () => { };
|
|
||||||
} else {
|
|
||||||
this.setWait(keyOrType, fn);
|
|
||||||
return () => {
|
|
||||||
this.delWait(keyOrType, fn);
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
this.setWait(keyOrType, fn);
|
||||||
|
return () => {
|
||||||
|
this.delWait(keyOrType, fn);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
register(data: any, key?: IPublicTypeEditorValueKey): void {
|
register(data: any, key?: IPublicTypeEditorValueKey): void {
|
||||||
@ -328,4 +326,4 @@ export class Editor extends (EventEmitter as any) implements IPublicModelEditor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const commonEvent = new EventBus(new EventEmitter());
|
export const commonEvent = new EventBus(new EventEmitter());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user