监听2个值的变化,后执行方法

data() {
  return {
    city: '',
    country: ''
  }
},
computed: {
  address() {
    const { city, country } = this
    return {
      city,
      country
    }
  }
},
watch: {
  address: {
    handler: function(newval , oldval) {
      console.log('address new =:' + newval );
      console.log('address old =:' + oldval );
    },
    deep: true
  }
原文地址:https://www.cnblogs.com/taochengyong/p/11082347.html