小程序自动生成图片的标签

<view class="name" wx:for="{{array}}" wx:key="index">
      <image style="transform:translate({{item.offsetX}}px, {{item.offsetY}}px) ;" class="img" id="{{stv.id[index]}}" src="../images/upload.png"></image>
    </view>

  

onBind: function (e) {
    var that = this;
    var index = this.data.index++;
    console.log(e);
    this.data.array.push({
      offsetX: e.changedTouches[0].pageX,
      offsetY: e.changedTouches[0].pageY-100,
      name: "景点"+index
    })
    console.log(this.data.array);
    this.setData({
      array: this.data.array
    })
  }

  

猜你喜欢

转载自www.cnblogs.com/xiangxiang521/p/10120527.html