微信小程序 - 關於下拉刷新


 1   // 拉取數據
 2   fetchData: function() {  3  wx.request({  4       url: 'http://v.juhe.cn/toutiao/index',  5  data: {  6         type: '',  7         key: '482e213ca7520ff1a8ccbb262c90320a'
 8  },  9  header: { 10         'contentType': 'application/json'
11  }, 12       success: function(res) { 13  console.log(res.data) 14  } 15  }); 16  }, 17 
18   // 下拉刷新
19   onPullDownRefresh: function() { 20     console.log('onPullDownRefresh', '下拉刷新....'); 21     this.fetchData(); 22  wx.stopPullDownRefresh; 23   },

 

即重新調用請求數據.... 建議邏輯分開寫


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM