3👍
✅
You lost context,
Use bind:
methods: {
reloadMessage() {
setTimeout(function () {
this.$http.get(window.BaseUrl + '/message/inbox');
}.bind(this), 1500);
}
}
or arrow function:
methods: {
reloadMessage() {
setTimeout(() => this.$http.get(window.BaseUrl + '/message/inbox'), 1500);
}
}
Source:stackexchange.com