0Pricing
Vue Academy · Lesson

Mutations and Actions

Change state with mutations and async actions.

Changing State Safely

In Vuex you never modify state directly from a component. Instead, all changes go through mutations. This single, explicit path makes every state change traceable and debuggable in Vue DevTools.

What Is a Mutation?

A mutation is a synchronous function that receives the current state and changes it. Mutations are the only place where state is allowed to be modified.

mutations: {
  increment(state) {
    state.count++
  }
}

All lessons in this course

  1. Vuex Fundamentals
  2. Mutations and Actions
  3. Getters and Modules
← Back to Vue Academy