mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-17 06:01:34 +00:00
fix(vue-app): triggerScroll when transitions is disabled (#8225)
This commit is contained in:
parent
005daebfce
commit
2c6610cfb8
@ -650,6 +650,8 @@ function fixPrepatch (to, ___) {
|
|||||||
const instances = getMatchedComponentsInstances(to)
|
const instances = getMatchedComponentsInstances(to)
|
||||||
const Components = getMatchedComponents(to)
|
const Components = getMatchedComponents(to)
|
||||||
|
|
||||||
|
let triggerScroll = <%= features.transitions ? 'false' : 'true' %>
|
||||||
|
|
||||||
Vue.nextTick(() => {
|
Vue.nextTick(() => {
|
||||||
instances.forEach((instance, i) => {
|
instances.forEach((instance, i) => {
|
||||||
if (!instance || instance._isDestroyed) {
|
if (!instance || instance._isDestroyed) {
|
||||||
@ -667,12 +669,17 @@ function fixPrepatch (to, ___) {
|
|||||||
Vue.set(instance.$data, key, newData[key])
|
Vue.set(instance.$data, key, newData[key])
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure to trigger scroll event after calling scrollBehavior
|
triggerScroll = true
|
||||||
window.<%= globals.nuxt %>.$nextTick(() => {
|
|
||||||
window.<%= globals.nuxt %>.$emit('triggerScroll')
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (triggerScroll) {
|
||||||
|
// Ensure to trigger scroll event after calling scrollBehavior
|
||||||
|
window.<%= globals.nuxt %>.$nextTick(() => {
|
||||||
|
window.<%= globals.nuxt %>.$emit('triggerScroll')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
checkForErrors(this)
|
checkForErrors(this)
|
||||||
<% if (isDev) { %>
|
<% if (isDev) { %>
|
||||||
// Hot reloading
|
// Hot reloading
|
||||||
|
Loading…
Reference in New Issue
Block a user