Yes they are supported, we don't mention them because it's like mutations
or actions
cases.
export const getters = {}
I guess they're a little awkward to interact with from within store/index.js
export const getters = {
foo: state => {
return 'bar'
}
}
export const actions = {
async DO_STUFF ({ dispatch, commit }) {
console.log(`Doing stuff with: ${getters.foo()}`) // odd that this is called as a function
}
}
Thanks.
You can access to your module getters through state.getters['the_module/the_getter']
, ie: state.getters['user/isAuthenticated']
.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
You can access to your module getters through
state.getters['the_module/the_getter']
, ie:state.getters['user/isAuthenticated']
.