网友真实露脸自拍10p,成人国产精品秘?久久久按摩,国产精品久久久久久无码不卡,成人免费区一区二区三区

小程序模板網

微信小程序學習筆記《一》:頁面的生命周期與參數傳遞

發布時間:2018-04-14 15:18 所屬欄目:小程序開發教程

作者:BillyJiang,來自原文地址

頁面的生命周期 
頁面跳轉的數據傳遞

1.了解頁面的生命周期(利用quickstart項目) 
index.wxml

 

				
  1. <view class="container">
  2. <view class="usermotto">
  3. <text class="user-motto" >文章1</text>
  4. </view>
  5. <view class="usermotto">
  6. <text class="user-motto">文章2</text>
  7. </view>
  8. </view>

index.js

 

				
  1. Page({
  2. data:{
  3.  
  4. },
  5. onLoad:function(options){
  6. // 生命周期函數--監聽頁面加載
  7. console.log("index onLoad")
  8. },
  9. onReady:function(){
  10. // 生命周期函數--監聽頁面初次渲染完成
  11. console.log("index onReady")
  12. },
  13. onShow:function(){
  14. // 生命周期函數--監聽頁面顯示
  15. console.log("index onShow")
  16. },
  17. onHide:function(){
  18. // 生命周期函數--監聽頁面隱藏
  19. console.log("index onHide")
  20. },
  21. onUnload:function(){
  22. // 生命周期函數--監聽頁面卸載
  23. console.log("index onUnload")
  24. },
  25. onPullDownRefresh: function() {
  26. // 頁面相關事件處理函數--監聽用戶下拉動作
  27. String7
  28. },
  29. onReachBottom: function() {
  30. // 頁面上拉觸底事件的處理函數
  31. String8
  32. },
  33. onShareAppMessage: function() {
  34. // 用戶點擊右上角分享
  35. return {
  36. title: 'title', // 分享標題
  37. desc: 'desc', // 分享描述
  38. path: 'path' // 分享路徑
  39. }
  40. }
  41. })

logs.js

 

				
  1. Page({
  2. data:{
  3.  
  4. },
  5. onLoad:function(options){
  6. // 生命周期函數--監聽頁面加載
  7. console.log("log onLoad")
  8. },
  9. onReady:function(){
  10. // 生命周期函數--監聽頁面初次渲染完成
  11. console.log("log onReady")
  12. },
  13. onShow:function(){
  14. // 生命周期函數--監聽頁面顯示
  15. console.log("log onShow")
  16. },
  17. onHide:function(){
  18. // 生命周期函數--監聽頁面隱藏
  19. console.log("log onHide")
  20. },


易優小程序(企業版)+靈活api+前后代碼開源 碼云倉庫:starfork
本文地址:http://www.xiuhaier.com/wxmini/doc/course/23402.html 復制鏈接 如需定制請聯系易優客服咨詢:800182392 點擊咨詢
QQ在線咨詢
AI智能客服 ×