fix: update title after navigation (#199)

zio/stable
Ayaka Rizumu 2022-11-28 21:55:51 +08:00 committed by GitHub
parent 17f76e5964
commit 3aa678898d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,12 @@
import type { ActiveHeadEntry, HeadEntryOptions, UseHeadInput } from '@vueuse/head'
import type { HeadAugmentations } from '@nuxt/schema'
import { useHead as _useHead } from '#head'
export function useHead<T extends HeadAugmentations>(input: UseHeadInput<T>, options?: HeadEntryOptions): ActiveHeadEntry<UseHeadInput<T>> | void {
const deactivated = useDeactivated()
return _useHead(() => {
if (deactivated.value)
return {}
return resolveUnref(input)
}, options)
}