小程序中使用swiper 组件 ,实现轮播图高度自适应效果。
先上最终实现效果图
先看一下微信官方文档介绍 swiper 组件
https://developers.weixin.qq.com/miniprogram/dev/component/swiper.html
代码部分
wxml:
<view class='images'>
<swiper class='detail-imgs' indicator-dots="{
{true}}" autoplay='{
{true}}' interval="{
{5000}}" duration="{
{500}}"