fix(vue-app): Set window. equals to window.{globalName} when defined

This commit is contained in:
Sébastien Chopin 2018-12-19 18:29:45 +01:00
parent 6c4280f87f
commit 951e745e54

View File

@ -66,10 +66,7 @@ export default {
Vue.prototype.<%= globals.nuxt %> = this Vue.prototype.<%= globals.nuxt %> = this
// add to window so we can listen when ready // add to window so we can listen when ready
if (typeof window !== 'undefined') { if (typeof window !== 'undefined') {
window.<%= globals.nuxt %> = this window.<%= globals.nuxt %> = <%= (globals.nuxt !== '$nuxt' ? 'window.$nuxt = ' : '') %>this
<% if (globals.nuxt !== '$nuxt') { %>
window.$nuxt = { $root: { constructor: this.$root.constructor } }
<% } %>
} }
// Add $nuxt.error() // Add $nuxt.error()
this.error = this.nuxt.error this.error = this.nuxt.error