小程序
小游戏
企业微信
微信支付
扫描小程序码分享
<view class="take1" wx:if="{{isGouc}}" bindtap='tapSeleBj' catchtouchmove="preventD">
<view class="takeCat" style="position:fixed;">
catchtouchmove="preventD"这种方法不管用啊
3 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
给蒙层标签添加一个catchtap事件响应,catchtap不同于bindtap的点是阻止下层向上冒泡,方法很笨,但很管用
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
这就是事件穿透的问题。
对于滑动事件,可以按照如下方法防止事件穿透。点击事件同理。
// wxml <view class="mask" catchtouchmove="onTouchMove" /> <view class="content" catchtouchmove="onTouchMove" > <slot/> </view> // js onTouchMove() {},
<view class="take1" wx:if="{{isGouc}}" mut-bind:tap="preventTouchMove">
<view class="takeCat" mut-bind:tap="get" style="{{isGouc?'position:fixed;':''}}">
用了互拆还挺管用的
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
给蒙层标签添加一个catchtap事件响应,catchtap不同于bindtap的点是阻止下层向上冒泡,方法很笨,但很管用
这就是事件穿透的问题。
对于滑动事件,可以按照如下方法防止事件穿透。点击事件同理。
// wxml <view class="mask" catchtouchmove="onTouchMove" /> <view class="content" catchtouchmove="onTouchMove" > <slot/> </view> // js onTouchMove() {},
<view class="take1" wx:if="{{isGouc}}" mut-bind:tap="preventTouchMove">
<view class="takeCat" mut-bind:tap="get" style="{{isGouc?'position:fixed;':''}}">
用了互拆还挺管用的