display-multiple-items 好多 bug 呀
display-multiple-items 大于 swiper-item 数量时,swiper-item 不显示
display-multiple-items 等于 swiper-item 数量时,无法切换
设置 display-multiple-items 后,开发工具中 swiper 有概率会卡死
不过还好有个骚方法,自己在前后各加个空白,也算能解决前两个
< swiper display-multiple-items = "{{3}}" bindchange = "swiperChange" > < swiper-item wx:for = "{{data}}" wx:key = "index" > < text class = 'campusItem {{current==index?"current":""}}' wx:if = "{{item}}" > < text class = 'text2' >{{"校区名称"}}</ text > </ text > </ swiper-item > </ swiper > |
data: { current: 0, data: new Array(3).fill( '1' ), }, onLoad: function (options) { var data = this .data.data; data.push( '' ); data.unshift( '' ); this .setData({ data: data, current: 1 }); }, swiperChange (e) { this .setData({ current: e.detail.current+1 }); } |
但还是恳求解决下以上问题吧,大佬辛苦。