Vuex Tips

Let’s look at some tips for making a Vuex application more manageable.

Strict mode

It’s a good idea to enable the strict mode in the development environment.

Press + to interact
const store = createStore({
// ...
strict: process.env.NODE_ENV !== 'production'
})

The strict mode helps prevent accidental mutations of the Vuex store. A warning is displayed if the store is mutated without using a mutation. Accidental mutations could result in ...