美文网首页
25.小程序穿透问题

25.小程序穿透问题

作者: jqClub | 来源:发表于2019-07-10 11:47 被阅读0次
    <view wx:if="{{alert}}" catchtouchmove="myCatchTouch">
        <template is="alert" data="{{alertData}}" />
    </view>
 myCatchTouch: function () {
    console.log('stop user scroll it!');
    return;
  },

也可以直接加上catchtouchmove="ture"

 <view wx:if="{{alert}}" catchtouchmove="true">
        <template is="alert" data="{{alertData}}" />
    </view>

在电脑上测试是没有用的,这是触摸事件。因此,需要在手机端测试,预览生成一个开发版,用手机微信扫描即可看到效果。

相关文章