You commit changes to state in Vuex using defined mutations
. You can easily access these state mutations in your template using mapMutations
. This lesson shows you have to wire together your Vue.js template with your Vuex store using mutations and mapMutations.
I don't see how store/index.js is included into component. Shouldn't it be explicitly imported?
Is there any reason why we mutate over copy? Wouldn't copy be 'safer'?