onLoad() {
var that = this;
uni.request({
url:'*****',
data:{},
header:{'Content-Type':'application/x-www-form-urlencoded'},
success:(res)=>{
console.log(res)
var data = res.data;
that.array = data;
},
fail: () => {
uni.showToast({
icon: 'none',
title: '网络异常,请稍后重试'
});
}
});
console.log(this.array)
}
uniapp通过uni.request给this中的变量赋值
最新推荐文章于 2024-03-06 13:52:35 发布