Skip to content

Commit

Permalink
fix(useScript): allow custom head instance
Browse files Browse the repository at this point in the history
  • Loading branch information
harlan-zw committed Oct 14, 2024
1 parent 9ff6c10 commit 1e16f41
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vue/src/composables/useScript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ export type UseScriptContext<T extends Record<symbol | string, any>> =

export function useScript<T extends Record<symbol | string, any> = Record<symbol | string, any>, U = Record<symbol | string, any>>(_input: UseScriptInput, _options?: UseScriptOptions<T, U>): UseScriptContext<UseFunctionType<UseScriptOptions<T, U>, 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()
Expand Down

0 comments on commit 1e16f41

Please sign in to comment.