微信小程序_(视图)简单的swiper容器
swiper容器效果 官方文档:传送门
swiper容器可实现简单的轮播图效果
结构程序
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
change:function(e){
console.log(e);
}
})
Gary 微信小程序 <swiper indicator-dots="true" autoplay="true" current="2" interval="2000" bindchange="change"> <swiper-item><view class = "item bc_green">0</view></swiper-item> <swiper-item><view class = "item bc_red">1</view></swiper-item> <swiper-item><view class = "item bc_blue">2</view></swiper-item> </swiper>