5👍
It’s because you are not binding this
in the callback of your http call. You could use an arrow function for example to solve it.
from
.then(function(res) {
console.log(res.data.address); // This returns the address
alert(res.data.address);
this.address=res.data.address;
})
to
.then((res) => {
console.log(res.data.address); // This returns the address
alert(res.data.address);
this.address=res.data.address;
})
- [Vuejs]-How can I redirect back to previous page after login on vue and laravel?
- [Vuejs]-Vue Js – removing spaces from string
Source:stackexchange.com