avalon
avalon copied to clipboard
在ms-repeat中avalon.oniui的resizable插件失效
具体代码如下
<script src="avalon.js"></script>
<script>
require(["resizable/avalon.resizable"], function() {
var vm = avalon.define({
$id: "icecream",
resizable: {
start: function() {
avalon.log("start")
},resize: function() {
avalon.log(avalon(this).offset().top);
vm.width = avalon(this).width();
vm.height = avalon(this).height();
},
drag: function(e, data) {
this.style.left = data.startLeft + e.pageX - data.startPageX + "px";
this.style.top = data.startTop + e.pageY - data.startPageY + "px"
}
},
imgList:[{'src':'image/1.jpg','width':311,'height':486,'boxWidth':311,'boxHeight':486,'posX':0,'posY':0,'boxPosX':0,'boxPosY':0}]
});
avalon.scan()
});
</script>
<style>
.drag {
position: absolute;
background-color: #ff0000;
overflow: hidden;
}
</style>

在ms-repeat外的div可以拖拽和变动大小,console也显示相应提示 但在ms-repeat中的div无法拖拽,且只能自由变动大小(aspectRatio限定无效),console无法显示相应提示
修改在repeat的ms-resizable为ms-resizable="icecream,resizable" 这里需要显示的指明配置项。