-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Hello! I have implemented similar solutions and applied the following to store/index.js
Just share here in case anyone needed
Because by the time if loading the computed property by Nuxt, it is not yet mounted, so any after-mount property for non-ssr environment such as `this.$store.state.route.path is not yet available.
// store/index.js
// tested on nuxt@1.4.0
import { sync } from 'vuex-router-sync'
export default {
actions: {
async nuxtServerInit ({ dispatch }, { app }) {
console.log('nuxtServerInit in index');
sync(app.store, app.router); // for life cycle such as computed value which is before mounted
}
}
}
Metadata
Metadata
Assignees
Labels
No labels