vm = new Vue({
el:'#root',
data:{
ishot:"ture"
},
methods:{
changeweather(){
this.ishot = !this.ishot
}
},
watch:{
/*
ishot:{
immediate:true,
deep:true;
handler(newValue,oldValue){
...
}
}*/
ishot(newValue,oldValue){
console.log('ishot被',newValue,oldValue);
}
},
computed:{
info(){
console.log('git被调用了')
return this.ishot ? '炎热' :'寒冷'
}}
})