FrontendDeveloper.in

Vue.js question detail

How do you watch for nested data changes?

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.

Back to all Vue.js questions
Get LinkedIn Premium at Rs 399