首页 > 微信 > 详细

微信小程序之swiper

时间:2020-04-10 09:22:14      阅读:91      评论:0      收藏:0      [点我收藏+]

 

微信小程序在插入轮播图时需要用到swiper滑块视图容器,

swiper 里只能放置swiper-item(插槽)组件,否则会导致未定义的行为。

<view>
    <image class="top-theme" src="{{themeA.entrance_img}}"></image>
    <swiper class="swiper-img"
            indicator-dots="{{true}}"
            indicator-active-color="#157658"
            circular
            autoplay
            interval="2000">
        <block wx:for="{{bannerB[0].items}}" wx:key="key">
            <swiper-item>
                <image class="swiper-img" src="{{item.img}}"></image>
            </swiper-item>
        </block>
    </swiper>
</view>

indicator-dots="{{true}}" :显示面板指示点

indicator-active-color="#157658" :设置选中的指示点颜色

circular:循环轮播
autoplay:自动切换
interval="2000":自动切换间隔时间、

示例:

技术分享图片

 

微信小程序之swiper

原文:https://www.cnblogs.com/bigpigcy/p/12670919.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!