页面的生命周期函数如下:
Page({ data:{ }, onLoad:function(options){ // 生命周期函数--监听页面加载 console.log("---index page onLoad---") }, onReady:function(){ // 生命周期函数--监听页面初次渲染完成 console.log("---index page oload---"); }, onShow:function(){ // 生命周期函数--监听页面显示 console.log("---index onshow--") }, onHide:function(){ // 生命周期函数--监听页面隐藏 console.log("--index onHide--") }, onUnload:function(){ // 生命周期函数--监听页面卸载 console.log("--index onUnload--") }, onPullDownRefresh: function() { // 页面相关事件处理函数--监听用户下拉动作 console.log("--index onPullDownRefresh--") }, onReachBottom: function() { // 页面上拉触底事件的处理函数 console.log("--index onReachBottom--") }, })
微信小程序里面的页面的跳转
这只是一种跳转方式:传值方式需要根据get请求
itemClick : function(){ wx.navigateTo({ url: '../logs/logs', success: function(res){ console.log(111) }, fail: function(res) { // fail }, complete: function(res) { // complete } }) }
第二种
redirect是否显示返回按钮
<navigator url="../logs/logs?id=100" redirect>文章一</navigator>
切换栏:taps
"tabBar": { "list": [{ "pagePath": "pagePath", "text": "text", "iconPath": "iconPath", "selectedIconPath": "selectedIconPath" }] }
只要需要两个