DEV Community

Discussion on: Watch for Vuex State changes!

Collapse
 
rolandcsibrei profile image
Roland Csibrei

IMHO there is a very important thing missing. If you want to watch for a FIELD change in an object or an item change in an array, you need to add deep:true to the watch method and use Vue.set to modify the watched object/array/field.

Collapse
 
viniciuskneves profile image
Vinicius Kiatkoski Neves

Hey Roland, thanks for your feedback.

That is true. I will update the article and add it (with links to the original docs about this corner case).

Nevertheless I strongly suggest to use Vue.set whenever possible to avoid pitfalls :)