<div class="static" v-bind:class={"active":isActive,"text-danger":hasError}></div>
vm.$data={
isActive:ture,
hasError:false
}
//最终的渲染结果
<div class="static active"></div>
<div class="static" v-bind:class="classObject"></div>
vm.$data.classObject={
active:true,
text-danger:false
}
//声明自定义组件
vm.component('my-component',{
template:'<p class="foo bar"></p>'
})
//在自定义组件中添加class
<my-component class="active"></my-component>
//最终渲染的结果
<p class="foo bar active"></p>
//使用v-bind进行渲染
<my-component v-bind:class="{active: true}"></my-component>
<div v-bind:style="styleObject"></div>
vm.$data.styleObject={
color:red,
font-size:30px
}