Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(useScriptTag): normalize src arg #2030

Merged
merged 1 commit into from Aug 3, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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