mounted: function() {
this.$watch(\'things\', function(){console.log(\'a thing changed\')}, true);
}
things
is an array of objects
You should pass an object instead of boolean as options
, so:
mounted: function () {
this.$watch('things', function () {
console.log('a thing changed')
}, {deep:true})
}
Or you could set the watcher into the vue
instance like this:
new Vue({
...
watch: {
things: {
handler: function (val, oldVal) {
console.log('a thing changed')
},
deep: true
}
},
...
})
[demo]