From 928bb3269ff204c0b52fa879e4d191feac023cc0 Mon Sep 17 00:00:00 2001 From: yiludege Date: Tue, 27 Sep 2022 12:11:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=BC=82=E6=AD=A5Java?= =?UTF-8?q?Script=E6=96=87=E4=BB=B6=E5=8A=A0=E8=BD=BD=E5=BC=82=E5=B8=B8=20?= =?UTF-8?q?(#188)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit close #184 * chore: 修改无极跳转地址 * fix: 修复异步JavaScript文件加载异常 --- packages/wujie-core/src/effect.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/wujie-core/src/effect.ts b/packages/wujie-core/src/effect.ts index a6ece40dc..5798976f0 100644 --- a/packages/wujie-core/src/effect.ts +++ b/packages/wujie-core/src/effect.ts @@ -224,11 +224,12 @@ function rewriteAppendOrInsertChild(opts: { const { src, text, type, crossOrigin } = element as HTMLScriptElement; // 排除js if (!isMatchUrl(src, getEffectLoaders("jsExcludes", plugins))) { - const execScript = (scriptResult) => { + const execScript = (scriptResult: ScriptObject) => { // 假如子应用被连续渲染两次,两次渲染会导致处理流程的交叉污染 if (sandbox.iframe === null) return warn(WUJIE_TIPS_REPEAT_RENDER); insertScriptToIframe(scriptResult, sandbox.iframe.contentWindow); - manualInvokeElementEvent(element, "load"); + // 只有外联转内联才需要手动触发load + if (scriptResult.content) manualInvokeElementEvent(element, "load"); element = null; }; const scriptOptions = {