先用computed定义一个address对象,然后再去watch addres。
data() {return { city: '',country: ''}},
computed: {
address() {
const { city, country } = this;
return {city, country
}
}
},
watch: {
address(val){
console.log(val)
}
}
————————————————
原文链接:https://blog.csdn.net/wsln_123456/article/details/102909272