0 votes
in VueJS by
How do you watch for nested data changes?

1 Answer

0 votes
by

You can use deep watcher by setting deep: true in the options object. This option enables us to detect nested value changes inside Objects.

vm.$watch('someObject', callback, {
  deep: true
})
vm.someObject.nestedValue = 123
// callback is fired

Note: This is not required to listen for Array mutations.

Related questions

0 votes
asked Sep 14, 2023 in VueJS by AdilsonLima
0 votes
asked Sep 12, 2023 in VueJS by AdilsonLima
...