const app = getApp()
Page({
sxbut:function () {
var that = this;
wx.request({
url: 'http://xxxxxx/xxxx.php',
method: 'GET',
data: {
nname: 'jack'
},
header: {
'content-Type': 'application/json'
},
success(res) {
console.log(res),
console.log(res.data),
that.setData({
List: res.data,
});
}
});
}
})
--------------------------------------------------------------------------------------
print:res.data显示:
Array
(
[0] => Array
(
[0] => jack
[name] => jack
[1] => 30
[age] => 30
[2] => 男
[xinbie] => 男
)
)
------------------------------------------------
wxml怎样写?让name,age,xinbie显示出来
先看文档吧 https://developers.weixin.qq.com/miniprogram/dev/reference/wxml/