refactor: group composables
This commit is contained in:
parent
97983e6d11
commit
9e9f2bde09
8 changed files with 54 additions and 56 deletions
13
composables/workarounds.ts
Normal file
13
composables/workarounds.ts
Normal file
|
@ -0,0 +1,13 @@
|
|||
import type { ActiveHeadEntry, HeadEntryOptions, UseHeadInput } from '@vueuse/head'
|
||||
import type { HeadAugmentations } from '@nuxt/schema'
|
||||
import { useHead } from '#head'
|
||||
|
||||
// TODO: Workaround for Nuxt bug: https://github.com/elk-zone/elk/pull/199#issuecomment-1329771961
|
||||
export function useHeadFixed<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…
Add table
Add a link
Reference in a new issue