简单了解:
常用属性:
简单代码示例:
主体:wxml
<swiper class="swiper-container" indicator-dots indicator-color="#fff" indicator-active-color="gray" autoplay interval="3000" circular>
<swiper-item>
<view class="item">A</view>
</swiper-item>
<swiper-item>
<view class="item">B</view>
</swiper-item>
<swiper-item>
<view class="item">C</view>
</swiper-item>
</swiper>
样式:wxss(不重要)
.swiper-container {
height: 150px;
}
.item {
width: 100%;
text-align: center;
line-height: 150px;
}
swiper-item:nth-child(1) .item {
background-color: lightgreen;
}
swiper-item:nth-child(2) .item {
background-color: lightblue;
}
swiper-item:nth-child(3) .item {
background-color: lightpink;
}
结果图: