Reputation: 83
I'm having trouble accessing the state of one of my namespaced modules inside my router. I imported my store
import store from "../store"
and acessing my getters like this works fine
let loggedIn = store.getters['auth/isLoggedIn'];
but this only gives me back undefined
:
let loggedIn = store.state['auth/user'];
How do I access my store?
Upvotes: 0
Views: 201
Reputation: 7739
For direct access to store state:
let loggedIn = store.state.auth.user;
Upvotes: 1