vue 监听data数据变化

当被监听的数据发生变化是,函数被执行
created() {
    this.$watch("Withdrawals", function (newValue, oldValue) {
    if(this.Withdrawals==false){
    console.log("123")
        }
    })
}
data(){
  return{
    Withdrawals:false
 }
}

 

posted @ 2017-12-11 16:24  learnoff  阅读(16062)  评论(3)    收藏  举报