@nuxt/vue-app
Advanced tools
Comparing version 2.14.6 to 2.14.7
/*! | ||
* @nuxt/vue-app v2.14.6 (c) 2016-2020 | ||
* @nuxt/vue-app v2.14.7 (c) 2016-2020 | ||
@@ -20,3 +20,3 @@ * - All the amazing contributors | ||
"node-fetch": "^2.6.1", | ||
unfetch: "^4.1.0", | ||
unfetch: "^4.2.0", | ||
vue: "^2.6.12", | ||
@@ -26,3 +26,3 @@ "vue-client-only": "^2.0.0", | ||
"vue-no-ssr": "^1.1.1", | ||
"vue-router": "^3.4.3", | ||
"vue-router": "^3.4.6", | ||
"vue-template-compiler": "^2.6.12", | ||
@@ -29,0 +29,0 @@ vuex: "^3.5.1" |
{ | ||
"name": "@nuxt/vue-app", | ||
"version": "2.14.6", | ||
"version": "2.14.7", | ||
"repository": "nuxt/nuxt.js", | ||
@@ -17,3 +17,3 @@ "license": "MIT", | ||
"node-fetch": "^2.6.1", | ||
"unfetch": "^4.1.0", | ||
"unfetch": "^4.2.0", | ||
"vue": "^2.6.12", | ||
@@ -23,3 +23,3 @@ "vue-client-only": "^2.0.0", | ||
"vue-no-ssr": "^1.1.1", | ||
"vue-router": "^3.4.3", | ||
"vue-router": "^3.4.6", | ||
"vue-template-compiler": "^2.6.12", | ||
@@ -26,0 +26,0 @@ "vuex": "^3.5.1" |
@@ -101,3 +101,4 @@ import Vue from 'vue' | ||
// Add this.$nuxt in child instances | ||
Vue.prototype.<%= globals.nuxt %> = this | ||
this.$root.$options.<%= globals.nuxt %> = this | ||
if (process.client) { | ||
@@ -104,0 +105,0 @@ // add to window so we can listen when ready |
@@ -47,2 +47,9 @@ import Vue from 'vue' | ||
Object.defineProperty(Vue.prototype, '<%= globals.nuxt %>', { | ||
get() { | ||
return this.$root.$options.<%= globals.nuxt %> | ||
}, | ||
configurable: true | ||
}) | ||
<% if (features.meta) { | ||
@@ -49,0 +56,0 @@ // vue-meta configuration |
@@ -5,7 +5,7 @@ <% if (router.scrollBehavior) { %> | ||
<%= isTest ? '/* eslint-enable quotes, semi, indent, comma-spacing, key-spacing, object-curly-spacing, space-before-function-paren */' : '' %> | ||
<% } else { %>import { getMatchedComponents } from './utils' | ||
<% } else { %>import { getMatchedComponents, setScrollRestoration } from './utils' | ||
if (process.client) { | ||
if ('scrollRestoration' in window.history) { | ||
window.history.scrollRestoration = 'manual' | ||
setScrollRestoration('manual') | ||
@@ -16,3 +16,3 @@ // reset scrollRestoration to auto when leaving page, allowing page reload | ||
window.addEventListener('beforeunload', () => { | ||
window.history.scrollRestoration = 'auto' | ||
setScrollRestoration('auto') | ||
}) | ||
@@ -22,3 +22,3 @@ | ||
window.addEventListener('load', () => { | ||
window.history.scrollRestoration = 'manual' | ||
setScrollRestoration('manual') | ||
}) | ||
@@ -28,3 +28,3 @@ } | ||
export default function (to, from, savedPosition) { | ||
export default function (to, from, savedPosition) { | ||
// If the returned position is falsy or an empty object, will retain current scroll position | ||
@@ -31,0 +31,0 @@ let position = false |
@@ -666,1 +666,7 @@ import Vue from 'vue' | ||
} | ||
export function setScrollRestoration (newVal) { | ||
try { | ||
window.history.scrollRestoration = newVal; | ||
} catch(e) {} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
166660
3583
Updatedunfetch@^4.2.0
Updatedvue-router@^3.4.6