请教,这样的对象,如何在视图中调用?
发布于 6 年前 作者 uqiao 14766 次浏览 来自 问答

这里的对象如何在视图中显示出来?

3 回复

微信小程序在模拟器上 https 能访问到数据,但是真机上不能建立数据连接。提示请使用 encryptedData 和 iv 字段进行解密,详见:https://mp.weixin.qq.com/debug/wxadoc/dev/api/open.html。难道不能直接用

wx.request({

          url: ‘https://mydomin.com/test/cjson.php’,

          method: ‘GET’,

            header: {

      ‘content-type’: ‘application/json’

              },

          success:function(res) {

              that.setData({

 

                  resultdd: res.data,

                  //resulterr:res.data.error

              })

              console.log(res.data)

          }

      })

可以通过【数据绑定】,将数据绑定到视图上,具体请看:

https://mp.weixin.qq.com/debug/wxadoc/dev/framework/view/wxml/data.html?t=20161222

回到顶部