4👍
Because axios.get
is an asynchronous method, console.log
is executed before the info is updated; To check the updated info, you’ll have to chain a then
method after axios.get(...)
, something like axios.get(...).then(...).then(() => console.log(this.info))
.
Source:stackexchange.com