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:
Daniel Roe 2022-04-09 10:46:29 +01:00 committed by GitHub
parent c98bea7d3c
commit f2fc135721
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)
} }