Currently, I'm encountering an issue while attempting to access my store from a helper function file:
import store from '../store'
let auth = store.getters.config.urls.auth
An error is being logged:
Uncaught TypeError: Cannot read property 'getters' of undefined.
I have experimented with the following as well:
this.$store.getters.config.urls.auth
However, the outcome remains the same.
This is what my store looks like:
//Vuex
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex);
const store = new Vuex.Store({
state: {
config: 'config',
},
getters: {
config: state => state.config
},
});
export default store
Any suggestions on how I can ensure my store is accessible outside of components?