watch 监听

2020-05-12  本文已影响0人  LUOTAOLUOTAO
watch: {
  value (newValue, oldValue) {
    console.log(newValue)
  }
}
watch: {
  arr: {
    handler (newValue, oldValue) {
      console.log(newValue)
    },
    deep: true
  }
}
watch: {
  obj: {
    handler (newValue, oldValue) {
      console.log(newValue)
    },
    deep: true
  }
}
watch: {
   'obj.name' (newValue, oldValue) {
    console.log(newValue)
  }
}
上一篇下一篇

猜你喜欢

热点阅读