mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
fix(bridge): don't call nuxt app if instance is inaccessible (#3906)
* fix(bridge): don't call nuxt app if instance is inaccessible * fix: early return if no instance, for clarity
This commit is contained in:
parent
19842ce471
commit
9ebea904f4
@ -13,10 +13,12 @@ declare module 'vue' {
|
||||
const metaMixin = {
|
||||
[metaConfig.mixinKey] () {
|
||||
const instance = getCurrentInstance()
|
||||
const options = instance?.type || /* nuxt2 */ instance?.proxy?.$options
|
||||
const nuxtApp = useNuxtApp()
|
||||
if (!instance) { return }
|
||||
|
||||
const options = instance.type || /* nuxt2 */ instance.proxy?.$options
|
||||
if (!options || !('head' in options)) { return }
|
||||
|
||||
const nuxtApp = useNuxtApp()
|
||||
const source = typeof options.head === 'function'
|
||||
? computed(() => options.head(nuxtApp))
|
||||
: options.head
|
||||
|
Loading…
Reference in New Issue
Block a user