movable-view组件(拖拽缩放)

1.wxml

movable-view组件
class='section'>
  class='section_title'>movable-view区域小于movable-area
  'height:200rpx;width:200rpx;background:red;'>
    "height:50rpx;width:50rpx;background:yellow;" x='{{x}}' y='{{y}}' direction='all' inertia='true'>
  
  class='btn-area'>
    
  
  movable区域大于movable-area
  'height:100rpx;width:100rpx;background:red;'>
    "height:200rpx;width:200rpx;background:blue;" direction='all' bindchange='onchange' bindscale='onscale' scale scale-min='0.5' scale-max='4' scale-value='2'>
  

2.JS

Page({
  data:{
    x:0,
    y:0
  },
  tap:function(e){
    this.setData({
      x:30,
      y:30
    });
  },
  onChange:function(e){
    console.log(e.detail);
  },
  onScale: function (e) {
    console.log(e.detail);
  }
})

movable-view组件(拖拽缩放)_第1张图片

 

 

 

感谢:https://www.bilibili.com/video/av61418389/?p=33

 

转载于:https://www.cnblogs.com/dzw159/p/11444151.html

你可能感兴趣的:(movable-view组件(拖拽缩放))