
左右滑动可以切换展示图片:
<!--pages/test/test.wxml--> <!-- 组件 --> <swiper> <swiper-item> <image></image> </swiper-item></swiper>
pages/test/test.js:
// pages/test/test.js
Page({
data: {
imgUrls:[
'http://dl.bizhi.sogou.com/images/1440x900/2014/05/14/611368.jpg',
'http://dl.bizhi.sogou.com/images/1440x900/2013/10/19/394877.jpg', 'http://img04.sogoucdn.com/app/a/100520093/ca86e620b9e623ff-d72d635343d5bade-dcf2acda7a45cb44f172db138bdf8d2d.jpg',
]
},
//事件处理函数
toupper:function(){
console.log("触发了toupper");
}
})
pages/test/test.wxss:
.img{
width: 100%;
}
心得:
swiper组件:滑块视图容器。
小程序管理平台系统源码是一套面向小程序服务商的一站式管理程序,基于 uniapp + ThinkPHP(PHP)开发,支持微信小程序、微信公众号与 H5 端。系统主打"全开源、独立部署、无限开 SAAS 账号",适合需要集中管理多个小程序、为客户代开通与授权的小程序服务商使用。
可以为swiper添加autoplay属性,是之自动播放,例如:autoplay=”true”
swiper组件中使用的是image单标签,而不是双标签(否则报错)。
推荐:《小程序开发教程》










