400 028 6601

建站动态

根据您的个性需求进行定制 先人一步 抢占小程序红利时代

几种动态设置样式的方法

样式类绑定:

使用对象:
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://mbwzsj.com/article/jioped.html

其他资讯

让你的专属顾问为你服务