小程序--轮播图

wxml页面

  interval :图片跳转的时间间隔

  autoplay:自动切换图片

  indicator-dots:图片下方的小圆点

  duration:滑动动画时长

// 注意⚠️:swiper组组件的直接子元素只可以是swiper-item,如果放置其他组件会自动被删除。但swiper-item下是可以放其他组件或者元素的
<
swiper indicator-dots='true' autoplay='true' interval='5000' vertical="{{false}}" duration="500"> <swiper-item> <image src="/images/post/[email protected]"></image> </swiper-item> <swiper-item> <image src="/images/post/[email protected]"></image> </swiper-item> <swiper-item> <image src="/images/post/[email protected]"></image> </swiper-item> </swiper>

wxss页面

swiper{
  width: 100%;
  height: 600rpx;
}
swiper image{
  width: 100%;
  height: 600rpx;
}

效果图:

    小程序--轮播图