为什么我用avalon.ready()后面也写了avalon.scan(),但绑定的css还是无效
如题所述问题!!
如题所述问题!!
2016-06-22
试试这个
<body ms-controller="test">
    <script>
        avalon.define({
            $id: 'test',
            obj: {backgroundColor: '#3bb0d0',width:300, height:50, 'text-align': 'center'},//属性名带-,必须用引号括起
            active: {color: 'red'},
            width:  300,
            height: 60,
            toggle: true,
            array: [{width:100},{height:50},{border: '1px solid #5cb85c'}]
        })    </script>
  <div ms-css="@obj">直接引用对象</div>
  <div :css="{width: @width, height: @height,background: 'pink'}">使用对象字面量</div>
  <div :css="@array">直接引用数组</div>
  <div :css="[@obj, @toggle && @active ]" :click="@toggle = !@toggle">选择性添加多余属性或重写已有属性</div></body>
举报