监听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
  }

 

上一篇:将PHP页面显示为图像


下一篇:mysql高级查询命令