微信小程序 - 关于下拉刷新


 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