swiper、swiper-item轮播图
swiper
是滑块视图容器。其中只可放置swiper-item
组件。部分常用属性如下,其余属性详见:官方文档
html
<view class="banner">
<swiper
previous-margin="30rpx"
circular
autoplay
interval="3000"
indicator-dots
indicator-active-color="#BDA066"
indicator-color="rgba(255,255,255,0.3)"
>
<swiper-item>
<image src="/images/banner0.jpg" mode=""/>
</swiper-item>
<swiper-item>
<image src="/images/banner1.jpg" mode=""/>
</swiper-item>
<swiper-item>
<image src="/images/banner2.jpg" mode=""/>
</swiper-item>
<swiper-item>
<image src="/images/banner3.jpg" mode=""/>
</swiper-item>
</swiper>
</view>