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

ms-resizable 和ms-repeat联合使用,repeat 出来的子元素不能拖拽,只能拖拽改变大小 #767

Open
caixiaojian opened this issue Sep 30, 2015 · 1 comment

Comments

@caixiaojian
Copy link

ms-resizable 和ms-repeat联合使用,repeat 出来的子元素不能拖拽,只能拖拽改变大小
代码示意:

<div ms-controller="demo">
   <div ms-repeat="items" ms-resizable >
       {{el}}
   </div>
</div>
define(["avalon", "../../../common/vendor/oniui/resizable/avalon.resizable"], function(avalon, siderbar) {
    avalon.define({
        $id: "demo",
        items: [1,2,3,4],
        resizable :  {
            start: function() {
                avalon.log("start resize")
            },
            drag: function(e, data) {
                this.style.left = data.startLeft + e.pageX - data.startPageX  + "px"
                this.style.top = data.startTop + e.pageY - data.startPageY  + "px"
            }
        }
    })

})

不知道是不是bug,或者请问怎么才能解决我的需求,我希望可以使数组里的元素具备draggable,resizable的能力

@yuhaoju
Copy link
Contributor

yuhaoju commented Sep 30, 2015

这的确是个问题,不过你可以通过直接指定组件的VM和配置项名字来解决,如:

<div ms-controller="test">
    <div ms-repeat="arr">
        <div class="outer" ms-resizable="test, resizable"></div>
    </div>
</div>

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