avalon2的例子为何运行时无效果呢

<body ms-controller="test">
    <script>
        avalon.define({
            $id: 'test',
            obj: {color: 'blur ', 'text-algin': 'center'},//属性名带-,必须用引号括起
            active: {color: 'red'},
            width: 111,
            height:222,
            toggle: false,
            array: [{width:1},{height:2}]
        })

    </script>
  <span ms-css="@obj">直接引用对象</span>
  <span :css="{width: @width, height: @height}">使用对象字面量</span>
  <span :css="@array">直接引用数组</span>
  <span :css="[@obj1, @toggle && @active ]" :click="@active = !@active">选择性添加多余属性或重写已有属性</span>
</body>

这是一个例子,但在多种浏览器下运行都不能显示效果,
2,avalon2能运用于php之类的环境吗?

阅读 2.1k
1 个回答
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进