I have a code like below.
data():{
coor: [
{ "name": '',
"shoes": '' },
{ "name": '',
"shoes": '' }
]
watch:{
coor: {
handler(){
console.log('changed')
}
,deep: true
}
}
In this case if whichever value in coor is changed, watch works.
But my goal is I want to make the case divided by two like below.
watch:{
coor.name: {
handler(){
console.log('The name is changed')
}
,deep: true
},
coor.shoes: {
handler(){
console.log('The shoes are changed')
}
,deep: true
}
}
But it doens't work well. How can I solve this problem? Thank you so much for reading.