Skip to content

Commit

Permalink
fix: 修复异步JavaScript文件加载异常 (#188)
Browse files Browse the repository at this point in the history
close #184 

* chore: 修改无极跳转地址

* fix: 修复异步JavaScript文件加载异常
  • Loading branch information
yiludege authored Sep 27, 2022
1 parent 23e792a commit 928bb32
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/wujie-core/src/effect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 928bb32

Please sign in to comment.