搜了很多都说用两个变量控制,我也试了,没起作用,是跟开启了自动切换有关吗?
data: { imgUrls: [ {'url': '../../images/banner.jpg'}, {'url': '../../images/banner.jpg'}, {'url': '../../images/banner.jpg'},], cur: 0, currentSwiper: 0, autoplay: true, //是否自动轮播 interval: 2000, //间隔时间 duration: 500, //滑动时间},swiperChange: function (e) { //切换轮播图 console.log(e, e.detail.current, this.data.currentSwiper, this.data.cur) this.setData({ // currentSwiper: e.detail.current, })},
微信小程序开发问题解答
微信小程序开发者回答:
你这个自动切换就会触发的呀:https://developers.weixin.qq.com/miniprogram/dev/component/swiper.html
本文网址:http://www.91bianli.com/weixinxiaochengxu/41380.html