<div id="root">
<h2>今天天气很{{info}}</h2>
<button @click="change">切换天气</button>
</div>
new Vue({
el:"#root",
data:{
ishot:true
},
computed:{
info(){
return this.ishot : '炎热' : '凉爽'
}
},
methods:{
change(){
this.ishot = !this.ishot
}
}
})