From 0c6c69b011abb3ae7d7b0ecbae722d12566db7c2 Mon Sep 17 00:00:00 2001 From: Alexander Lichter Date: Sat, 24 Nov 2018 21:35:43 +0000 Subject: [PATCH] fix(scrollBehavior): emit triggerScroll event after changing layer (#4399) resolves: #4080 --- packages/vue-app/template/App.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/vue-app/template/App.js b/packages/vue-app/template/App.js index f67601cfe4..b79fac1772 100644 --- a/packages/vue-app/template/App.js +++ b/packages/vue-app/template/App.js @@ -34,6 +34,14 @@ export default { props: { name: '<%= layoutTransition.name %>', mode: '<%= layoutTransition.mode %>' + }, + on: { + beforeEnter(el) { + // Ensure to trigger scroll event after calling scrollBehavior + window.<%= globals.nuxt %>.$nextTick(() => { + window.<%= globals.nuxt %>.$emit('triggerScroll') + }) + } } }, [ templateEl ])