Changing month and year with Vuex mutation
Let's now add a mutation to the store.
So add a mutations property.
So we need, if you recall, if you want to change the value of the current year at the
current month or any state property then you need a mutation to to do that, and then a
component can call the mutation.
So a mutation is simply just a function.
So let's create one called setCurrentMonth, that way any component which needs to change
the current month can do so, and mutations
Click to load comments...