fix(vue-app): triggerScroll when transitions is disabled (#8225)

This commit is contained in:
Pim 2020-11-06 09:38:08 +01:00 committed by GitHub
parent 005daebfce
commit 2c6610cfb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -650,6 +650,8 @@ function fixPrepatch (to, ___) {
const instances = getMatchedComponentsInstances(to)
const Components = getMatchedComponents(to)
let triggerScroll = <%= features.transitions ? 'false' : 'true' %>
Vue.nextTick(() => {
instances.forEach((instance, i) => {
if (!instance || instance._isDestroyed) {
@ -667,12 +669,17 @@ function fixPrepatch (to, ___) {
Vue.set(instance.$data, key, newData[key])
}
// Ensure to trigger scroll event after calling scrollBehavior
window.<%= globals.nuxt %>.$nextTick(() => {
window.<%= globals.nuxt %>.$emit('triggerScroll')
})
triggerScroll = true
}
})
if (triggerScroll) {
// Ensure to trigger scroll event after calling scrollBehavior
window.<%= globals.nuxt %>.$nextTick(() => {
window.<%= globals.nuxt %>.$emit('triggerScroll')
})
}
checkForErrors(this)
<% if (isDev) { %>
// Hot reloading