You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 [email protected]
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
}
}
}
The text was updated successfully, but these errors were encountered:
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.The text was updated successfully, but these errors were encountered: