🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
条件渲染、列表渲染、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> ~~~