先用computed定義一個address對象,然后再去watch addres
1 data() { 2 return { 3 city: '', 4 country: '' 5 } 6 }, 7 computed: { 8 address() { 9 const { city, country } = this 10 return { 11 city, 12 country 13 } 14 } 15 }, 16 watch: { 17 address(val){ 18 console.log(val) 19 }
20 }