

el:'#app',
data:{
meter:1000,
kilameter:1
},
watch:{
meter:function(val){
this.kilameter = val * 0.1;
},
kilameter:function(val){
this.meter = val *1000;
}
}
}) el:'#app',
data:{
arr:[1,2,3]
},
watch:{
arr:function(oldV,newV){
console.log(oldV);
console.log(newV);
}
}
}) el:'#app',
data:{
obj : {
a:111,
b:222
}
},
watch:{
obj:{
handler:function(oldV,newV){
console.log(oldV);
},
deep:true
}
}
)相关推荐:
