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, Â ...