Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在ie8上 ms-if-loop + ms-repeat只针对第一个有效~ 怎么处理 求指教 #1060

Closed
kingnuoyan opened this issue Sep 18, 2015 · 1 comment

Comments

@kingnuoyan
Copy link

<!DOCTYPE html>
<html>
<head>
    <title>avalon测试</title>
    <meta charset='utf-8' />
    <script src='avalon.js'></script>
    <script>
    var model = avalon.define({
        $id:'demoCtrl',
        item:[{id:'1',name:'哪吒'},{id:'2',name:'法海'},{id:'3',name:'白素贞'},{id:4,name:'许仙'}],
        statu:true,
        change:function() {

            setTimeout(function(){

    if(model.statu){
                model.statu = false;
            } else {
                model.statu = true;
            }

            },50);
        }
    })
    </script>
</head>
<body>
    <div ms-controller='demoCtrl'>
        <button ms-repeat-obj='item' ms-if-loop='statu'>{{obj.name}}</button>
        <button ms-click='change'>测试隐藏</button>
    </div>
</body>
</html>'
@RubyLouvre
Copy link
Owner

我明白是什么原因了
因为IE cloneNode太强大了
它会复制我为元素添加的自定义属性 uuid
然后我以这个元素为蓝本进行repeat
于是它们的uuid都一致
我改用IE 私有的uniqueNumber 去处理

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants