微信小程序阻止 swiper 滑动

===========================================================================

代码段

===========================================================================

< swiper class= "tab-content" current= "{{currentTab}}" duration= "300" bindchange= "switchTab"
style= "height:{{winHeight-100}}rpx">
< swiper-item wx:for= "{{ answersList }}" catchtouchmove= "stopSwiper" wx:for-index= "index" wx:key= "key" wx:for-item= "item">
< scroll-view scroll-y= "true" class= "scoll-h">
< view class= 'qt_til'>
< text >{{ index+1 }} </ text >. {{ item.title }}
</ view >
< radio-group data-index= "{{ index }}" bindchange= "radioChange">
< view class= 'qt_choose' wx:for= "{{item.og}}" wx:key= "key_child" wx:for-index= "index_child" wx:for-item= "item_child">
< text >{{ item_child.options }} </ text >
< radio class= 'fr' name= "{{ index_child }}" value= "{{ item_child.grades }}"></ radio >
</ view >
</ radio-group >
</ scroll-view >
</ swiper-item >
</ swiper >

===========================================================================

说明:给swiper-item  设置 catchtouchmove="stopSwiper" 然后在相关js文件中定义空函数stopSwiper即可

===========================================================================


猜你喜欢

转载自blog.csdn.net/qq_39977679/article/details/79820487