ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、视频、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
条件渲染、列表渲染、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> ~~~