收藏
回答

movable-area改变长宽后,movable-view移动区域大小没变

WXML:


<button bindtap='tapHandler'>change size</button>
<movable-area class="move_container" style="width:{{width}}px;height:{{height}}px;">
    <movable-view class="move_item" style="width:{{length}}px; height:{{length}}px;" direction="all" x="{{x-length/2}}" y="{{y-length/2}}"></movable-view>
</movable-area>


WXSS:

.move_container {
    /* position: absolute; */
     margin: 0 auto;
    border: 2rpx solid red;
}
 
.move_item {
    opacity: 0.7;
    background: red;
    border-radius: 50%;
}


JS:

Page({
    data: {
        width: 100,
        height: 100,
        length: 50,
        x: 22,
        y: 22,
    },
    onLoad: function (options) {
    },
    tapHandler: function () {
        this.setData({
            width: 300,
            height: 300,
            x: 111,
            y: 111
        })
    },
)}


回答关注问题邀请回答
收藏

11 个回答

  • tomfriwel
    tomfriwel
    2018-01-13

    有官方能看下嘛?

    2018-01-13
    有用
    回复

正在加载...

登录 后发表内容