小程序拖拽组件


  <movable-area style="height: {{H*2}}rpx;width: {{W*2}}rpx; position: fixed; top: 0;">
    <movable-view direction="all" style="height: 100rpx; width: 100rpx; text-align: center; line-height: 100rpx; background: yellow;" x="{{x}}" y="{{y}}">
      <text class='iconfont icon-del'></text>
    </movable-view>
  </movable-area>
page({
    data: {
        x: 200,
        y: 300,
    },
    onLoad() {
        this.setData({
            W: wx.getSystemInfoSync().windowWidth,   // 获取当前窗口的宽度
            H: wx.getSystemInfoSync().windowHeight    // 获取当前窗口的高度
        })
    }
})

猜你喜欢

转载自blog.csdn.net/BetterGG/article/details/84943442
今日推荐