fix: ensure emit triggerScroll event after scrollBehavior is called

This commit is contained in:
ktsn 2018-06-21 15:22:52 +09:00
parent feabdcafaa
commit bf6416ae62

View File

@ -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)
}