diff --git a/packages/vue-app/template/client.js b/packages/vue-app/template/client.js index a05e24f054..f207d3c594 100644 --- a/packages/vue-app/template/client.js +++ b/packages/vue-app/template/client.js @@ -160,7 +160,7 @@ async function loadAsyncComponents(to, from, next) { } this.error({ statusCode, message }) - this.$nuxt.$emit('routeChanged', to, from, err) + this.<%= globals.nuxt %>.$emit('routeChanged', to, from, err) next() } } diff --git a/packages/vue-app/template/components/nuxt-link.client.js b/packages/vue-app/template/components/nuxt-link.client.js index aff42b05a4..7e4b35585e 100644 --- a/packages/vue-app/template/components/nuxt-link.client.js +++ b/packages/vue-app/template/components/nuxt-link.client.js @@ -66,7 +66,7 @@ export default { }, canPrefetch() { const conn = navigator.connection - const hasBadConnection = this.$nuxt.isOffline || (conn && ((conn.effectiveType || '').includes('2g') || conn.saveData)) + const hasBadConnection = this.<%= globals.nuxt %>.isOffline || (conn && ((conn.effectiveType || '').includes('2g') || conn.saveData)) return !hasBadConnection },