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
I'm importing several modules on the fly to compose my router regarding the user context. For example, a US user will have different routes available than a IT user.
I'm also adding conditions inside of the router to enable or not some routes depending on feature flags, which are in my Vuex store.
Here is actually the problem: I can't have any access to the Vuex store at this point. Since I already have it (for sure) instantiated before, I wonder if this is possible to retrieve the store object from the createRouter method in order for me to support my conditional imports.
Hi,
I'm currently using the router plugin (https://www.npmjs.com/package/@nuxtjs/router) in order to do the following behavior:
Here is actually the problem: I can't have any access to the Vuex store at this point. Since I already have it (for sure) instantiated before, I wonder if this is possible to retrieve the store object from the
createRouter
method in order for me to support my conditional imports.https://github.com/nuxt/nuxt.js/blob/2ec62617ced873fef97c73a6d7aa1271911ccfd5/packages/vue-app/template/router.js#L104
I guess this is the place to look at, but it's weird to see the router initialized before the store here 🤔. Do you think it would have a big impact to create the store beforehand?
https://github.com/nuxt/nuxt.js/blob/eb6bd9febc63146622f56f9cb20511510400e6c5/packages/vue-app/template/index.js#L94-L105
Thanks!
The text was updated successfully, but these errors were encountered: