1.

swiper组件实现水平滑动切换,有时候只想通过点击按钮切换,需要禁用手动滑动切换,让它返回一个false就好了呀。可以用下面的实现方法:

2.

wxml:在swiper-item增加一个方法

3.

swiper-itemcatchtouchmove"stopTouchMove"

4.

js:方法实现返回false

5.

stopTouchMove:function(){

6.

returnfalse;

7.

}

TAG标签: 微信小程序中如何禁止手动滑动swiper组件小程序swiper怎么禁用swiper小程序

http://www.xiaochengxub.com/read-96802.html