Skip to content

Commit

Permalink
fix: useScript options type broken
Browse files Browse the repository at this point in the history
  • Loading branch information
harlan-zw committed Mar 27, 2024
1 parent 409ba7e commit f51aaa8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/runtime/composables/useScript.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { type UseScriptInput, type VueScriptInstance, useScript as _useScript, injectHead } from '@unhead/vue'
import type { UseScriptOptions } from '@unhead/schema'
import { onNuxtReady, useNuxtApp } from '#imports'
import type { NuxtUseScriptOptions } from '#nuxt-scripts'

export function useScript<T>(input: UseScriptInput, options?: Omit<UseScriptOptions<T>, 'trigger'> & {
trigger?: UseScriptOptions<T>['trigger'] | 'onNuxtReady'
}) {
export function useScript<T>(input: UseScriptInput, options?: NuxtUseScriptOptions) {
input = typeof input === 'string' ? { src: input } : input
options = options || {}
if (options.trigger === 'onNuxtReady')
Expand Down

0 comments on commit f51aaa8

Please sign in to comment.