vue watch deep
watch: {
colors: {
handler(newValue){
console.log('colors changed', newValue)
}, deep: true
}
}
4.3
11
watch: {
item: {
handler(val){
// do stuff
},
deep: true
}
}
Thank you!
11
0
3.57
7
export default {
name: 'ColorChange',
props: {
colors: {
type: Array,
required: true,
},
},
watch: {
colors: {
// This will let Vue know to look inside the array
deep: true,
// We have to move our method to a handler field
handler(value) {
console.log('The list of colors has changed!', value);
}
}
}
}
Thank you!
7
0
Are there any code examples left?
New code examples in category Javascript