[Vuejs]-Unable to access `get` method in vue-resource

2👍

Methods should not be arrows function. The this will not point to the vue instance if a methods is declared using arrow function.

Use normal function instead:

methods: {
  fetchPosts(){
    debugger;
    this.$http.get('my-url')
      .then(response => {
        console.log(response)
      })
  } 

You can see the warning here

Leave a comment