@genyded
Thanks, I just saw the documentation about the plugins, apparently the store is accessible directly from here.
Latest posts made by Gonzalo2683
-
RE: Access the store in routes.js to use navigation guards
-
RE: Access the store in routes.js to use navigation guards
Thanks for the example, a question ?, did not you need to import the store to be able to use it? Because I try to use it directly and I do not have access to it.
This is the store in which I am testing, it is a function that is being exported, I am maintaining as function it because the idea is to be able to use it with SSR. When I import this store and access to state from here vuex does not work properly.
import Vue from 'vue'; import Vuex from 'vuex'; import example from './module-example'; import config from './config/config'; Vue.use(Vuex); /* * If not building with SSR mode, you can * directly export the Store instantiation */ export default function (/* { ssrContext } */) { const Store = new Vuex.Store({ state: { value: 0, }, getters: { value: state => state.value, }, mutations: { updateValueMut: (state, payload) => { state.value = payload; }, }, actions: { updateValueAct({ commit }, payload) { commit('updateValueMut', payload); }, }, }); return Store; }
-
RE: How to apply access control to different routes in quasar?
530/5000
The answer given by admin is not very explanatory. I am having the same problem as accessing the status in the routes.js file, I am using the SSR version.What I did was import the store in the routes.js file but this apparently creates a new store instance and the state settings through actions and mutations do not seem to work.
How would be the correct way to reference the store in the routes.js file in order to use navigation guards?