条件渲染、列表渲染、Class与Style绑定
===
### 条件渲染
- v-if
- v-else,v-else-if
- v-show
~~~
<div id="app">
{{msg}}
<div v-if="count > 0" style="background: red">
count>0 count value is : {{count}}
</div>
<div v-else style="background: aquamarine">
count value is : {{count}}
</div>
<button @click="countAdd">CountAdd</button>
<button @click="countJj">CountJj</button>
</div>
<script>
new Vue({
el:"#app",
data:{
msg:"hello Vue",
count:0
},
methods:{
countAdd:function () {
this.count ++
},
countJj:function () {
this.count --
}
}
})
</script>
~~~