diff --git a/vue/app-client.js b/vue/app-client.js index 558a914..2462fdb 100644 --- a/vue/app-client.js +++ b/vue/app-client.js @@ -34,18 +34,13 @@ router.onReady(() => { // async components are resolved. router.beforeResolve(async (to, from, next) => { const matched = router.getMatchedComponents(to) - const prevMatched = router.getMatchedComponents(from) - let diffed = false - const activated = matched.filter((c, i) => { - return diffed || (diffed = (prevMatched[i] !== c)) - }) // Register dyanmic store modules on route change (not direct load!) registerStoreModules(root, store) - activated.map(component => registerStoreModules(component, store, true)) + matched.map(component => registerStoreModules(component, store, true)) // Call asyncData - await Promise.all(activated.map(c => callAsyncRecursive(c, store, router, to, progress))) + await Promise.all(matched.map(c => callAsyncRecursive(c, store, router, to, progress))) // End loading bar progress.finish() diff --git a/vue/ssr/callAsyncRecursive.js b/vue/ssr/callAsyncRecursive.js index 947d9ae..86bc4c6 100644 --- a/vue/ssr/callAsyncRecursive.js +++ b/vue/ssr/callAsyncRecursive.js @@ -14,6 +14,7 @@ const callAsyncRecursive = async (parent, store, router, route, progress) => { if (parent.asyncData) { if (!progressStarted && progress) { progress.start() + progressStarted = true } parent.$router = router parent.$store = store