As Vuex, I\'m trying to update an object using form. My code like this.
In store:
const state = {
categories: []
};
//mutations:
[mutationType.UP
and much more simple, just use methods to modify arrays (never modify them directly) (check this: https://vuejs.org/2016/02/06/common-gotchas/#Why-isn%E2%80%99t-the-DOM-updating even old and DOM related, is still valid)
So just find your object and replace with splice in your mutation:
const index = state.objectsArray.map(o => o.id).indexOf(newObject.id);
state.objectsArray.splice(index, 1, newObject);