Vue $http.get loads page plus returns NULL

Asked

Viewed 37 times

1

I’m trying to consume an API and $http.get only returns NULL. I call a PHP that returns a json

What a fool I’m doing?

 new Vue({
el:'#beerApp',

data:{
    cervejarias: null
},
methods:{
    getChamados: function(){
        this.$http.get('listar_cervejarias.php').then(function(response){
            this.cervejarias = response.data;
        }, function(error){
            console.log(error.statusText);
        });
    }
},
mounted: function () {
    this.getChamados();
}


});
  • What is the code of listar_cervejarias.php?

  • Hello rafael [{"Id":"50630","Operator":"","Id_registration":"61693"}]

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.