1 2 3 4

fetch请求

1.fetch是浏览器自带的,不需要安装或引用,可直接使用

fetch('/api/products')
     .then(response=>response.json())
     .then(result=>{
            ....//处理数据
    })

 

posted @ 2020-06-01 16:37  红鲤鱼与LV  阅读(179)  评论(0编辑  收藏  举报