第一种
uni.request({
url:"请求地址",
success:res=>{
变量.value = res.data;
}
})
将数据整理一下进行遍历:
第二种
uni.request({
url:"请求地址"
}).then(res=>{
变量.value = res.data;
})
第三种
async function 函数名 (){
let res = await uni.request({
url:"请求地址"
})
变量.value = res.data;
}