If here is my store.js file:
const state = {
count: 0,
loggedIn: false
}
const mutations = {
UP_COUNT(state) {
state++;
}
}
const actions = {
upCount({ commit }) {
commit('UP_COUNT');
}
}
Let's say to increase state count from one of my Vue components, I will call an action which then commits a mutation:
this.$store.dispatch('upCount');
Then let's say in another Vue component, I want to use the state count:
<div class="count">{{ this.$store.state.count }}</div>
What is wrong with this style? (vs using $this.store.getters...)