写微信小程序请求JSON数据时遇到的问题
发表时间:2020-9-28
发布人:葵宇科技
浏览次数:74
写微信小程序请求JSON数据时遇到的问题
getJSON: function () {
    var that = this
    wx.request({
      url: '不让看', //仅为示例,并非真实的接口地址
      
      header: {
        'content-type': 'application/json' // 默认值
      },
      success (res) {
        console.log((res.data).Information)
        that.setData({
          list: res.data.Information
        })
       
        
      },
that = this必须写,关乎能否取到list值得问题,
 res.data.对象名 才取到对象的列表。








