無論什麼項目,一個輪播是基本少不了的,如今就來踩下微信小程序的swiper吧!html
首先打開文檔,能夠看到下面這些參數:(https://mp.weixin.qq.com/debug/wxadoc/dev/component/swiper.html)小程序
後面有詳細的解說,我就不一一說了!主要看下面的!微信小程序
<swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}"> <block wx:for="{{imgUrls}}"> <swiper-item> <image src="{{item}}" class="slide-image" width="355" height="150"/> </swiper-item> </block> </swiper>
變量設置在data當中

將默認的寬高去掉,而後給個樣式!
默認指示點是爲false的,咱們要改爲true
修改指示點的顏色: