[Vuejs]-How do I use computed with nested Vuex Object

3👍

No need for a watch, here are two ways to make the property reactive:

Option one: Declare the property in your state object:

myObj = { someNumericalId: [] };

Option two: Use Vue.set to add the property to your object in mutations:

Vue.set(state.myObj, someNumericalId, []);

After this, push method should automatically trigger updates.

👤Psidom

Leave a comment