mirror of
https://github.com/elk-zone/elk.git
synced 2024-11-04 16:09:59 +00:00
fix: update title after navigation (#199)
This commit is contained in:
parent
17f76e5964
commit
3aa678898d
1 changed files with 12 additions and 0 deletions
12
composables/useHead.ts
Normal file
12
composables/useHead.ts
Normal 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)
|
||||
}
|
Loading…
Reference in a new issue