[Vuejs]-Vue Js-Error in callback for watcher "function () { return this._data.$$state }": "Error: [vuex] do not mutate vuex store state outside mutation

0👍

This is because you mutate state outside mutations and it’s there:

this.systemstatus.splice(i, 1)

You could copy systemstatus by using spread operator, for example:

const systemStatusCopy = [...this.systemstatus]

and you won’t get any errors, however state won’t change either, but if you need it to change in a store, then add mutation and commit a mutation whenever you need.

Leave a comment