I'm learning VueJS and I figure out the usage of this
in some cases. By example: to access some atribute in the data()
.
But, I tried to call a method inside another method and was doing nothing because I wasn't using this
to call the other method. Can someone explain the more detailed the general and in this case usage of this
?
methods:{
sendData(){
this.$http.post('FIREBASE-LINK/data.json', this.user).then(response=>{
console.log(response)
this.getData()
}).catch(err=>{
console.log(err)
})
},
getData: function () {
this.$http.get('FIREBASE-LINK/data.json').then(resp=>{
this.users = resp.body
}).catch(err=>{
console.log(err)
})
}
}