Vue.js中 watch 的高级用法

 

handler方法,immediate属性deep属性:

handler(newVal, oldVal){
        if (newVal > 0) {
          this.ableAdd = true
          this.getListData()
        } else {
          this.ableAdd = false
          this.tableData = []
          this.total = 0
        }
      },
      immediate: true,
      deep: true

 

https://blog.csdn.net/wandoumm/article/details/80259908

posted @ 2019-08-12 10:03  谢书怜  阅读(299)  评论(0编辑  收藏  举报