uView——Http请求

简介

  uView封装了uni-app的请求.....

 

重点1. 同步请求

  使用

    await 限制方法强制同步。

    asyn:awiat关键字必须写在asyn方法里

async onLoad() {
            let indexUrl = 'https://api.shop.eduwork.cn/api/index';
            await this.$u.get(indexUrl).then(res=>{console.log(res);})
            console.log(1);
        }

 

posted @ 2021-12-03 16:15  remix_alone  阅读(1351)  评论(0)    收藏  举报