微信小程序之滑块视图容器(swiper)
来源:互联网 发布:it就业培训学校 编辑:程序博客网 时间:2024/05/19 03:41
看图:
实现起来特别简单,看看代码是怎么写的呢:
<swiper class="swiper" indicator-dots="{{indcatorDots}}" autoplay="{{autoPlay}}" interval="{{interval}}" duration="{{duration}}"> <block wx:for="{{imgUrls}}" wx:for-index="index"> <swiper-item> <image src="{{item}}" class="side-img"></image> </swiper-item> </block></swiper>
这就是布局了,看一下js里面代码:
Page({ data: { imgUrls: [ 'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg', 'http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg', 'http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg'], indcatorDots: true, autoPlay: true, interval: 5000, duration: 500 },
,swiper有以下一些常用属性:
标记的两个属性暂时不管。
注意:其中只可放置组件,否则会导致未定义的行为。
swiper-item
仅可放置在组件中,宽高自动设置为100%。
就是这样,自己动手试试。
1 0
- 微信小程序之滑块视图容器(swiper)
- 2.1.3微信小程序滑块视图容器 swiper
- 微信小程序—swiper(滑块视图容器)
- swiper-滑块视图容器
- 实现滑块视图容器 swiper
- 【微信小程序】视图容器-swiper组件
- 微信小程序的视图容器—swiper
- 04、swiper 滑块视图容器的使用
- 小程序开发总结3:swiper滑块视图
- 微信小程序基础组件之视图容器
- 微信小程序之swiper轮播图
- 微信小程序入门之swiper
- 微信小程序----组件之swiper
- 微信小程序之swiper轮播图
- 微信小程序:视图容器
- 微信小程序之swiper无缝轮播
- 微信小程序之顶部选项卡(swiper)
- 微信小程序开发手记之四:视图容器
- 递归。。爬楼梯
- 1.23
- zookeeper清理日志
- sql的nvl用法
- 开源第三方登录组件OAuthLogin2.0 架构解析及开源地址
- 微信小程序之滑块视图容器(swiper)
- 句柄泄漏调试经验
- LeetCode 384. Shuffle an Array
- excellentexport--一个可以导出报表的插件
- Android Studio 统计项目的代码总行数
- 使用for in遍历数组
- hadoop集群部署
- 欢迎使用CSDN-markdown编辑器
- TCP/IP、Http、Socket的区别