几种动态设置样式的方法
                                            样式类绑定:
使用对象:
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://www.scyingshan.cn/article/jioped.html

 建站
建站
 咨询
咨询 售后
售后
 建站咨询
建站咨询 
 