The video for this lesson is currently being updated, please read the transcript instead.

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

To view the complete lesson you'll need to login or join this course.


Click to load comments...