data.map is not a function

后端 未结 9 1137
轮回少年
轮回少年 2020-12-02 05:50

I\'m bashing my head against an error I can\'t work out how to fix. I have the following;

JSON

{\"products\":
[
    {
        \"product_id\" : \"123         


        
9条回答
  •  庸人自扰
    2020-12-02 06:24

    this.$http.get('https://pokeapi.co/api/v2/pokemon')
    .then(response => {
       if(response.status === 200)
       {
          this.usuarios = response.data.results.map(usuario => {
          return { name: usuario.name, url: usuario.url, captched: false } })
              }
        })
    .catch( error => { console.log("Error al Cargar los Datos: " + error ) } )
    

提交回复
热议问题