小程序 轮播图 swiper 使用
时间:2020-02-09 00:32:39
收藏:0
阅读:227
个人示例
<swiper autoplay="true" indicator-dots="{{true}}" class="ad-swiper" indicator-color="rgba(255, 255, 255, .5)" indicator-active-color="#FFF">
<block wx:for="{{advertisements}}" wx:key="ad_id" wx:for-item="it1">
<swiper-item wx:for="{{it1.ad_image}}" wx:key="id" wx:for-item="it2" bindtap="adTap" data-jumptype="{{it1.jump_type}}" data-appid="{{it1.miniapp_appid}}" data-path="{{it1.miniapp_page_path}}" data-url="{{it1.jump_url}}">
<image class="ad-img" src="{{it2.url}}"></image>
</swiper-item>
</block>
</swiper>
官方示例
<swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}">
<block wx:for="{{background}}" wx:key="*this">
<swiper-item>
<view class="swiper-item {{item}}"></view>
</swiper-item>
</block>
</swiper>
评论(0)