Page({ onLoad:function(){ // 在onLoad中调用发送请求的函数 this.getProList(); } getProList:function(){ var self=this; // 在这里向服务端发送请求 wx.request({ url:"", method:"GET", success:function(res){ // 数据的赋值写在setData()方法里 self.setData({ proList:res.data }) } }) } })
小程序-API请求
原创
©著作权归作者所有:来自51CTO博客作者蓝色海岛的原创作品,请联系作者获取转载授权,否则将追究法律责任
上一篇:小程序-基础库兼容
下一篇:小程序-小菊花loading
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
【小程序】API
小程序API概述以及分类
小程序 微信小程序 java API 本地存储