Answer the question
In order to leave comments, you need to log in
Vuex. what is the correct way to use getters?
Do I need to write a similar getter, or can I just refer to this.$store.state.counter in the component?
export const store = new Vuex.Store({
state: {
counter: 0 as number,
},
getters: {
counter: state => () => state.counter,
},
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question