vue给元素动态绑定样式
时间:2021-06-18 19:58:55
收藏:0
阅读:0
<div :style="{ color: activeColor, fontSize: fontSize + ‘px‘ }"></div>
data () {
return {
//初始样式
activeColor:‘red‘,
fontSize :30,
};
},
//改变样式
this.activeColor=‘#000‘,
this.fontSize=20
评论(0)