vue中的class和style的使用

vue中的class和style的使用

v-bind:class的使用
1.第一种使用方式
v-bind:class=’[a,b,c]‘形式的用法
a b c是data中的数据
vue中的class和style的使用
2.第二种使用方式
v-bind:class=’{}'形式的用法
vue中的class和style的使用
当然也可以配合着数据一起使用
vue中的class和style的使用
3:第三种使用方式(其实和第二种方式是一样的)
v-bind:class=‘json’,引号里可以直接存放一个json类型的变量,其实也就是第二种形式的写法,换了一个地方而已
vue中的class和style的使用
v-bind:style的使用

1:第一种使用方式
vue中的class和style的使用
2:第二种使用方式(其实就是第一种方法的位置换了一个地方)
vue中的class和style的使用
3:第三种用法
vue中的class和style的使用