0👍
✅
When you want to watch
nested data (array or object) you need to set deep
to true
in you watcher.
I encourage you to read the official Vuejs doc about watcher : https://v2.vuejs.org/v2/api/#watch
In your case you would have something like that :
watch: {
element: {
deep: true,
handler: function (val, oldVal) {
console.log('updated')
}
}
}
Source:stackexchange.com