refactor: 限制引擎 init 只能调用一次

This commit is contained in:
lihao.ylh 2021-08-13 14:58:19 +08:00
parent 44d93de9e9
commit a68eaf902f

View File

@ -175,7 +175,10 @@ plugins.register((ctx: ILowCodePluginContext) => {
},
};
});
let engineInited = false;
export async function init(container?: HTMLElement, options?: EngineOptions) {
if (engineInited) return;
engineInited = true;
let engineOptions = null;
let engineContainer = null;
if (isPlainObject(container)) {