微信小程式--實現swiper切換
阿新 • • 發佈:2019-01-07
// pages/qurry1/query1.js
var util = require('../../utils/util.js');
Page({
/**
* 頁面的初始資料
*/
data: {
currentTab: 0,
active: false,
},
// tab的切換
tabNav: function (e) {
if (this.data.currentTab === e.target.dataset.current) {
return false;
} else {
this.setData({
currentTab: e.target.dataset.current,
})
}
},
bindChange: function (e) {
this.setData({ currentTab: e.detail.current });
},
/** * 生命週期函式--監聽頁面載入 */ onLoad: function (options) { },
/** * 生命週期函式--監聽頁面初次渲染完成 */ onReady: function () {
},
/** * 生命週期函式--監聽頁面顯示 */ onShow: function () {
},
/** * 生命週期函式--監聽頁面隱藏 */ onHide: function () {
},
/** * 生命週期函式--監聽頁面解除安裝 */ onUnload: function () {
},
/** * 頁面相關事件處理函式--監聽使用者下拉動作 */ onPullDownRefresh: function () {
},
/** * 頁面上拉觸底事件的處理函式 */ onReachBottom: function () {
},
/** * 使用者點選右上角分享 */ onShareAppMessage: function () {
} })
/** * 生命週期函式--監聽頁面載入 */ onLoad: function (options) { },
/** * 生命週期函式--監聽頁面初次渲染完成 */ onReady: function () {
},
/** * 生命週期函式--監聽頁面顯示 */ onShow: function () {
},
/** * 生命週期函式--監聽頁面隱藏 */ onHide: function () {
},
/** * 生命週期函式--監聽頁面解除安裝 */ onUnload: function
},
/** * 頁面相關事件處理函式--監聽使用者下拉動作 */ onPullDownRefresh: function () {
},
/** * 頁面上拉觸底事件的處理函式 */ onReachBottom: function () {
},
/** * 使用者點選右上角分享 */ onShareAppMessage: function () {
} })