在微信小程序中,SWIPER组件是一个用于展示轮播图的组件。要获取当前显示的轮播图项(即当前ITEM),可以通过监听`currentSlide`属性来实现。以下是一个简单的示例:
1. 首先,在页面的`
```
2. 在页面的`
```css
.swiper-container {
width: 100%;
height: 100%;
}
.swiper-slide {
text-align: center;
font-size: 18px;
background-color: #fff;
color: #333;
line-height: 36px;
display: flex;
align-items: center;
justify-content: center;
font-weight: bold;
margin-bottom: 15px;
}
```
3. 在页面的``标签中添加SWIPER组件和相关内容:
```html
```
4. 在页面的`