Skip to content

Commit

Permalink
fix: adjust code
Browse files Browse the repository at this point in the history
  • Loading branch information
imtaotao committed Jul 28, 2021
1 parent 06b2d72 commit a9500be
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/runtime/browser-vm/src/dynamicNode/processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ export class DynamicNodeProcessor {
this.DOMApis = new DOMApis(sandbox.global.document);
this.rootElement = rootElm(this.sandbox) || document;
this.tagName = el.tagName ? el.tagName.toLowerCase() : '';

// Deal with some static resource nodes
if (sourceListTags.includes(this.tagName)) {
this.fixResourceNodeUrl();
}
}

private is(tag: string) {
Expand Down Expand Up @@ -173,10 +178,6 @@ export class DynamicNodeProcessor {
this.sandbox.replaceGlobalVariables.recoverList.push(() => {
this.DOMApis.removeElement(this.el);
});
// Deal with some static resource nodes
if (sourceListTags.includes(this.tagName)) {
this.fixResourceNodeUrl();
}

// Add dynamic script node by loader
if (this.is('script')) {
Expand Down

0 comments on commit a9500be

Please sign in to comment.