Watching nested properties
When using Vue.js to watch a data property, you can observe changes belonging to nested keys of an object, rather than observing the changes to the object itself.
This is done by setting the optional deep
property to true
:
data() { return { organization: { name: 'ABC', employees: [ 'Jack', 'Jill' ] } } }, watch: { organization: { handler(v) { this.sendIntercomData() }, deep: true, immediate: true, ...