摘要: 使用:style可以给元素绑定内联样式,方法与:class类似,也有对象语法和数组语法,看起来很像直接在元素上写css. <div id="app"> <div :style="{'color':color, 'fontSize':fontSize+'px'}">文本</div> </div> <s 阅读全文
posted @ 2020-03-08 22:02 小清秋 阅读(334) 评论(0) 推荐(0) 编辑
摘要: 一、对象语法 1、给v-bind:class 设置一个对象,可以动态地切换class,例如: <div id="app"> <div :class="{'active':isActive}"></div> </div> <script> var app = new Vue({ el:'#app', 阅读全文
posted @ 2020-03-08 21:37 小清秋 阅读(10712) 评论(0) 推荐(1) 编辑