Level 9
You can watch for an attribute in object, like this
watch: {
'booking.carSize' (val) {
// do something
}
and you should return in data ()
data() {
return {
booking: {
name:
carNumber:
carSize
}
}
}
Summer Sale! All accounts are 50% off this week.
So my data is structured like this:
data() {
booking: {
name:
carNumber:
carSize
}
}
But what I would like to do is to only watch the carSize data. Is that possible? I'm doing this right now but that is watching all changes made to the booking object
watch: {
booking: {
deep: true,
handler () {
this.getServices(this.booking.carSize);
}
}
},
You can watch for an attribute in object, like this
watch: {
'booking.carSize' (val) {
// do something
}
and you should return in data ()
data() {
return {
booking: {
name:
carNumber:
carSize
}
}
}
Please or to participate in this conversation.