mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
fix(nuxt3): remove useMeta warning (#4216)
* fix(nuxt3): remove useMeta warning for now * Update packages/nuxt3/src/head/runtime/composables.ts Co-authored-by: pooya parsa <pyapar@gmail.com>
This commit is contained in:
parent
c98bea7d3c
commit
f2fc135721
@ -16,16 +16,8 @@ export function useHead (meta: MetaObject | ComputedGetter<MetaObject>) {
|
|||||||
useNuxtApp()._useHead(resolvedMeta)
|
useNuxtApp()._useHead(resolvedMeta)
|
||||||
}
|
}
|
||||||
|
|
||||||
const _warned = {}
|
|
||||||
const warnOnce = (id: string, message: string) => {
|
|
||||||
if (!_warned[id]) {
|
|
||||||
console.warn(message)
|
|
||||||
_warned[id] = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// TODO: remove useMeta support when Nuxt 3 is stable
|
// TODO: remove useMeta support when Nuxt 3 is stable
|
||||||
/** @deprecated */
|
/** @deprecated Please use new `useHead` composable instead */
|
||||||
export function useMeta (meta: MetaObject | ComputedGetter<MetaObject>) {
|
export function useMeta (meta: MetaObject | ComputedGetter<MetaObject>) {
|
||||||
warnOnce('useMeta', '[meta] useMeta has been renamed to useHead.')
|
|
||||||
return useHead(meta)
|
return useHead(meta)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user