0👍
Simple answer: I should have been using an arrow function in the first promise.
Change:
.then(function (response) {
console.log(response.data.word);
this.randomWord = response.data.word;
})
to:
.then((response) => {
this.randomWord = response.data.word;
})
A better explanation can be found here: Vue – Cannot set property of undefined in promise
Source:stackexchange.com