fetch请求

get请求

return fetch('https://xxx.xxx.com/xxx.json')
  .then(response => response.json())
  .then(responseJson => {
     this.carList = responseJson.data
     console.log(this.carList)
     //  console.log(this.carList[1].id)
   }).catch(error => {
      console.log(error)
   })

 

posted @ 2018-03-28 15:02  嘆世殘者——華帥  阅读(142)  评论(0)    收藏  举报