Skip to content

Commit

Permalink
fix(useScriptTag): normalize src arg (#2030)
Browse files Browse the repository at this point in the history
  • Loading branch information
huynl-96 committed Aug 3, 2022
1 parent 8b21ca2 commit 8f2b799
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/useScriptTag/index.ts
Expand Up @@ -98,7 +98,7 @@ export function useScriptTag(
// Local variable defining if the <script> tag should be appended or not.
let shouldAppend = false

let el = document.querySelector<HTMLScriptElement>(`script[src="${src}"]`)
let el = document.querySelector<HTMLScriptElement>(`script[src="${resolveUnref(src)}"]`)

// Script tag not found, preparing the element for appending
if (!el) {
Expand Down Expand Up @@ -171,7 +171,7 @@ export function useScriptTag(
if (scriptTag.value)
scriptTag.value = null

const el = document.querySelector<HTMLScriptElement>(`script[src="${src}"]`)
const el = document.querySelector<HTMLScriptElement>(`script[src="${resolveUnref(src)}"]`)
if (el)
document.head.removeChild(el)
}
Expand Down

0 comments on commit 8f2b799

Please sign in to comment.