mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
fix: ensure emit triggerScroll event after scrollBehavior is called
This commit is contained in:
parent
feabdcafaa
commit
bf6416ae62
@ -32,7 +32,10 @@ export default {
|
||||
// Add triggerScroll event on beforeEnter (fix #1376)
|
||||
let beforeEnter = listeners.beforeEnter
|
||||
listeners.beforeEnter = (el) => {
|
||||
window.$nuxt.$emit('triggerScroll')
|
||||
// Ensure to trigger scroll event after calling scrollBehavior
|
||||
window.$nuxt.$nextTick(() => {
|
||||
window.$nuxt.$emit('triggerScroll')
|
||||
})
|
||||
if (beforeEnter) return beforeEnter.call(_parent, el)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user