如何做网站实名认证,专业创建网站,网站开发形式选择,专业制作网站多少钱vue中watch基本用法#xff1a; new Vue({el: #t1,data: {a: {b: 1,c: 2},},methods: {ch() {this.a.d5 //不打印ok 原理是watch只watch挂在data中的数据#xff0c;初始化时给他们分别赋予setter与getter#xff0c;如果是中途加上的属性#xff0c;由于没有sette…vue中watch基本用法 new Vue({el: #t1,data: {a: {b: 1,c: 2},},methods: {ch() {this.a.d5 //不打印ok 原理是watch只watch挂在data中的数据初始化时给他们分别赋予setter与getter如果是中途加上的属性由于没有setter与getter不会被watch到。 this.a.c5 //打印ok 测试时与上面代码只写一个。}},watch: {a:{ handler{ console.log(ok) } deep:true }}}//html div classt1 idt1 button clickch/button /div }转载于:https://www.cnblogs.com/gsgs/p/6821819.html