chrome ie9以上没有问题
代码如下
<ul ms-controller="list">
<li ms-for="(index,el) in @items" ms-attr="{class:@fn(index)}" >
{{el}}
</li>
</ul>
<script>
var list = avalon.define({
$id:"list",
items:["1","2","3"],
fn:function(index){
if(index===0){
return 'first-row';
}else if(index===this.items.length-1){
return 'last-row';
}else{
return '';
}
}
});
</script>
class类添加失败
已解决
ms-attr
换成了
:class="@fn(index)"