chore: avoid useHead
naming conflicts
This commit is contained in:
parent
0acc0f7689
commit
98a647f8ca
16 changed files with 19 additions and 18 deletions
|
@ -5,7 +5,7 @@ const isPreview = window.location.hostname.includes('deploy-preview')
|
|||
|
||||
export function usePageHeader() {
|
||||
const i18n = useI18n()
|
||||
useHead({
|
||||
useHeadFixed({
|
||||
htmlAttrs: {
|
||||
lang: () => i18n.locale.value,
|
||||
},
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
import type { ActiveHeadEntry, HeadEntryOptions, UseHeadInput } from '@vueuse/head'
|
||||
import type { HeadAugmentations } from '@nuxt/schema'
|
||||
import { useHead as _useHead } from '#head'
|
||||
import { useHead } from '#head'
|
||||
|
||||
export function useHead<T extends HeadAugmentations>(input: UseHeadInput<T>, options?: HeadEntryOptions): ActiveHeadEntry<UseHeadInput<T>> | void {
|
||||
// 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(() => {
|
||||
return useHead(() => {
|
||||
if (deactivated.value)
|
||||
return {}
|
||||
return resolveUnref(input)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue