I have a JSON like this
'criteria': [
{
'row': {
'name': '1',
'values': [{}]
}
},
{
'row': {
'name': '2',
'values': [{}]
}
}
]
I tried this
watch: {
criteria: {
deep: true,
handler () {
console.log(this.criteria)
}
}
}
But it is watching every change in the criteria. How can i watch only Values? Is there any way to write a custom function and return what ever i want to watch like in angular?
Updated :
I tried this as well
computed: {
test () {
var values = []
_.forEach(this.criteria, function (criteria) {
_.forEach(criteria.row, function (row) {
values.push(row.values)
})
})
return values
}
},
watch: {
test () {
console.log("changed")
}
}
Still watching every thing.