swiper 组件,刚进入时 current:0 左侧不显示,要手动滑一下才显示 current:2.
刚进入时的状态
稍微滑动一下后的正常状态
//curInfo:0
<swiper class="swiper" current="{{curInfo}}" circular="true" previous-margin="184rpx" next-margin="184rpx"bindchange="changeSwiper">
<swiper-item wx:for="{{3}}" wx:key="item" class="flex-center item_swiper">
<view class="flex-center swiper_info">
<text class="title_50 text_600">{{index}}</text>
</view>
</swiper-item>
</swiper>
.swiper {
width: 100vw;
height: 460rpx;
background-color: #FDF0F7;
border-top: 10rpx solid #111111;
border-bottom: 10rpx solid #111111;
}
.item_swiper {
width: 100% !important;
height: 100% !important;
justify-content: center;
}
.swiper_info {
width: 380rpx !important;
height: 380rpx !important;
background-color: #FEC82E;
border-radius: 100%;
justify-content: center;
}
.swiper_case {
width: 100%;
height: 100%;
}
你的
curInfo
为0
肯定就是你一开始的截图的状态啊,当前的下标又不是1
。并且你想要显示多个滑块,也没有设置
display-multiple-items
属性。