1.修改层级
<swiper class="swipercss"
bindchange="changeSwiper"
style="height:670rpx">
<swiper >
//重点style没有scoped,
<style lang="less" >
.swipercss .wx-swiper-dot {
z-index: -10;
}
.swipercss .wx-swiper-dot.wx-swiper-dot-active {
z-index: -10;
}
.swipercss .wx-swiper-dots.wx-swiper-dots-horizontal {
z-index: -10;
}
</style>
2.自定义点点样式
效果图如下:
<swiper class="banana"
wx:if="{{menus_page.length>0}}"
indicator-dots="true"
style="height:395rpx;"
interval="{{interval}}"
indicator-dots="#DFDFDF"
indicator-active-color="#F2C04D"
duration="{{duration}}">
</swiper>
<style lang="less" >
.banana .wx-swiper-dot {
width: 15rpx;
height: 10rpx;
border-radius: 4rpx;
margin-right: 3rpx;
margin-left: 3rpx;
// margin-left: 2rpx;
}
.banana .wx-swiper-dot.wx-swiper-dot-active {
// 选中的大小
width: 28rpx;
height: 10rpx;
border-radius: 4rpx;
// margin-right: 3rpx;
// margin-left: 3rpx;
}
.banana .wx-swiper-dots.wx-swiper-dots-horizontal {
margin-top: 60rpx;
//这里可以改变左右位置
}
</style>