<swiper autoplay vertical circular indicator-dots indicator-color="#fff" indicator-active-color="#888"
interval="2500" duration="1000">
<swiper-item wx:for="{{imgUrls}}" wx:k="*this">
<image src="{{item}}" mode="aspectFill"></image>
</swiper-item>
</swiper>
image{
width: 100vw;
height: 100vh;
}
swiper{
height: 100vh;
}
Page({
data:{
imgUrls:[
"../../images/pic1.jpg",
"../../images/pic2.jpg",
"../../images/pic3.jpg",
"../../images/pic4.jpg"
]
}
})

- swiper
indicator-dots
,是否显示面板指示点,布尔值 ,默认是false,即不显示。indicator-color
,指示点颜色。indicator-active-color
,当前选中的指示点颜色。autoplay
,是否自动切换,布尔值,默认是false,即不切换。interval
,自动切换时间间隔,数值,默认是5000,单位是毫秒。duration
,滑动动画时长,数值,默认是500,单位是毫秒。vertical
,滑动方向是否是纵向,布尔值,默认是false,即默认横向滑动。circular
,是否采用衔接滑动,布尔值,默认是false,即不衔接滑动。
- image
mode
,图片裁剪、缩放的模式
aspectFit
,缩放模式,保持纵横比缩放图片,只保证图片的短边能完全显示出来。也就是说,图片通常只在水平或垂直方向是完整的,另一个方向会发生截取。