hover绑定

用于类实现:hover伪类的效果, 当用户鼠标移动元素上方时添加几个类名, 鼠标移走时将刚才的 类名移除

用法类似于类名绑定,要求属性值为字符串,多个类名以空格隔开; 为对象时,键名为类名,键值为布尔或01,为数组时,为字符串数组

vm.aaa = "aaa bbb ccc"
vm.bbb = {
   aa: 1,
   bb: 2,
   cc: 3
}
vm.ccc = ['xxx', 'yyy', 'zzz']
<span ms-hover="@aaa">直接引用字符串</span>
<span ms-hover="@bbb">直接引用对象</span>
<span ms-hover="@ccc">直接引用数组</span>
<span ms-hover="{aaa: @toggle, bbb: @toggle2}">使用对象字面量</span>
<span ms-hover="['aaa', 'bbb',(@toggle? 'ccc':'ddd")]">使用数组字面量,里面可以用三元运算符</span>
Copyright © 司徒正 2013-2016 all right reserved,powered by Gitbook该文件修订时间: 2016-07-11 12:20:30

results matching ""

    No results matching ""