mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
fix(vue-app): null
check for $root
access (#9150)
Co-authored-by: Payel <payelk@ngdata.com>
This commit is contained in:
parent
4a95333a13
commit
20e7b99eb6
@ -46,7 +46,7 @@ Vue.component(Nuxt.name, Nuxt)
|
|||||||
|
|
||||||
Object.defineProperty(Vue.prototype, '<%= globals.nuxt %>', {
|
Object.defineProperty(Vue.prototype, '<%= globals.nuxt %>', {
|
||||||
get() {
|
get() {
|
||||||
const globalNuxt = this.$root.$options.<%= globals.nuxt %>
|
const globalNuxt = this.$root ? this.$root.$options.<%= globals.nuxt %> : null
|
||||||
if (process.client && !globalNuxt && typeof window !== 'undefined') {
|
if (process.client && !globalNuxt && typeof window !== 'undefined') {
|
||||||
return window.<%= globals.nuxt %>
|
return window.<%= globals.nuxt %>
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user