成都创新互联网站制作重庆分公司

几种动态设置样式的方法

样式类绑定:

使用对象:
computed:{ divClasses:function(){ return { red:this.attachRed, blue:!this.attachRed } } } 使用命名: css中定义.red,.green,.blue样式。
data:{ attachRed:false, color:'greed' } 动态设置样式,不使用CSS类:
computed:{ mystyle:function(){ return { backgroundColor:this.color, width:this.width + 'px' } } } 数组语法设置元素样式

文章题目:几种动态设置样式的方法
网站路径:http://cxhlcq.com/article/jioped.html

其他资讯

在线咨询

微信咨询

电话咨询

028-86922220(工作日)

18980820575(7×24)

提交需求

返回顶部