微信小程序 —— 自定义轮播图swiper dots默认样式

前端之家收集整理的这篇文章主要介绍了微信小程序 —— 自定义轮播图swiper dots默认样式前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

        
      
    
  

<view class="dots">
<block wx:for="{{slider}}" wx:key="unique">
<view class="dot{{index == swiperCurrent ? ' active' : ''}}">


.swiper-container{
  position: relative;
  height: 300rpx;
}
.swiper-container .swiper{
  height: 300rpx;
  width: 100%;
}
.swiper-container .swiper .img{
  width: 100%;
  height: 100%;
}
.swiper-container .dots{
  position: absolute;
  left: 0px;
  right: 0px;
  bottom: 20rpx;
  display: flex;
  justify-content: center;
}
 .swiper-container .dots .dot{
  margin: 0px 8rpx;
  width: 14rpx;
  height: 14rpx;
  background: #fff;
  border-radius: 8rpx;
  transition: all 0.6s;
}
.swiper-container .dots .dot.active{
  width: 24rpx;
  background: #f80;
} 
// pages/swipernew/swipernew.js
Page({

/**

猜你在找的微信小程序相关文章