<view> <swiper circular="{{true}}" current="{{currentTap}}"> <swiper-item> <text>11111111</text> </swiper-item> <swiper-item> <text>2222</text> </swiper-item> <swiper-item> <text>3333</text> </swiper-item> </swiper> <view style="display:flex;height:100rpx"> <button catchtap="preBtn">上一页</button> <button catchtap="nextBtn">下一页</button> </view></view>data: { currentTap: 0},preBtn: function () { let newTap = 0; if (this.data.currentTap == 0) { newTap = 2; } else if (this.data.currentTap == 1) { newTap = 0; } else if (this.data.currentTap == 2) { newTap = 1; } console.log('点击上一页 newTap:' + newTap + ' currentTap:' + this.data.currentTap) this.setData({ currentTap: newTap })},nextBtn: function () { let newTap = 0; if (this.data.currentTap == 0) { newTap = 1; } else if (this.data.currentTap == 1) { newTap = 2; } else if (this.data.currentTap == 2) { newTap = 0; } console.log('点击下一页 newTap:' + newTap + ' currentTap:' + this.data.currentTap) this.setData({ currentTap: newTap })},
swiper组件设置circular衔接滑动时,手势左右滑动可达到衔接效果;
但是当通过设置current属性时,一直点击下一页,没有衔接效果;

感谢反馈。这里其实是因为设置current属性时,信息不足以判断应当向左滚动还是向右滚动。我们会考虑看看怎么优化这个问题。
你好,这个问题现在有解决方法了吗?
优化的怎么样了
感谢关注。我们会尽快添加一个新的属性,使得 circular 模式下能够指定滚动方向。
大哥,不需要那么复杂啊。。。找最短路径不就行了?!
那么,如果两边路径长度一样,应该往哪边呢?
我们会在尽可能不改变现有逻辑的情况下,提供较高的可配置性。
swiper-item数量为2个还是不能衔接啊
@LastLeaf 好的,辛苦了