修改官⽅swiper样式
从微信官⽅微信开发⽂档中⼼复制swiper 代码块。wxml定义
wxss定义样式
.wrap {
height: auto;
position: relative; width: 100%;}
.swipers {
height: 350rpx; width: 100%;}
.slide-image { display: block; width: 100%; height: 100%;}
/*⽤来包裹所有的⼩圆点 */.dots {
width: 156rpx; height: 36rpx; display: flex;
flex-direction: row; position: absolute; left: 320rpx; bottom: 20rpx;}
/*未选中时的⼩圆点样式 */.dot {
width: 26rpx; height: 26rpx;
border-radius: 50%; margin-right: 26rpx;
background-color: white;}
/*选中以后的⼩圆点样式 */.active {
width: 26rpx; height: 26rpx;
background-color: coral;}
赋值
Page({ data: { imgUrls: [
'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg', 'http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg', 'http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg' ],
currentSwiper: 0, autoplay: true },
swiperChange: function (e) { this.setData({
currentSwiper: e.detail.current }) }})
效果图:
总结
以上所述是⼩编给⼤家介绍的微信⼩程序修改swiper默认指⽰器样式的实例代码,希望对⼤家有所帮助,如果⼤家有任何疑问请给我留⾔,⼩编会及时回复⼤家的。在此也⾮常感谢⼤家对⽹站的⽀持!
因篇幅问题不能全部显示,请点此查看更多更全内容