效果图:
.wxml
<view class="history_txt">
<swiper class="tab_right" vertical="true" autoplay="true" circular="true" interval="3000" display-multiple-items='4'>
<view>
<block wx:for='{{historyTodayData}}' wx:key="year">
<swiper-item>
<view class='content_item'>
<text>{{item.title}}</text>
</view>
</swiper-item>
</block>
</view>
</swiper>
</view>
.wxss
.history_txt{
width: calc(100% - 100px);
height: 80px;
position: absolute;
top: 0;
right: 0;
overflow: hidden;
text-align: center;
}
.tab_right{
padding: 16px 8px;
}
.content_item{
height: 18px;
line-height: 18px;
font-size: 12px;
color:#666666;
}
historyTodayData为请求获取的数据,返回结构如下,historyTodayData=res.result