From 1e16f41c508139483b6c2597a9e7dfd813c9afac Mon Sep 17 00:00:00 2001 From: harlan Date: Mon, 14 Oct 2024 14:57:54 +1100 Subject: [PATCH] fix(useScript): allow custom `head` instance --- packages/vue/src/composables/useScript.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vue/src/composables/useScript.ts b/packages/vue/src/composables/useScript.ts index ada7d370..452b6d2c 100644 --- a/packages/vue/src/composables/useScript.ts +++ b/packages/vue/src/composables/useScript.ts @@ -35,8 +35,8 @@ export type UseScriptContext> = export function useScript = Record, U = Record>(_input: UseScriptInput, _options?: UseScriptOptions): UseScriptContext, T>> { const input = (typeof _input === 'string' ? { src: _input } : _input) as UseScriptResolvedInput - const head = injectHead() const options = _options || {} + const head = options.head || injectHead() // @ts-expect-error untyped options.head = head options.eventContext = getCurrentInstance()