Struggling with updating the content inside a vuetify v-alert
.
There's an issue when trying to update Vue component properties within the sessionID.then()
block after logging into a system and receiving a session id.
Vue.component('query-status', {
template: `
<div>
<v-alert :type="type">
{{ alertText }}
</v-alert>
</div>`,
data() {
return {
alertText: '',
type: 'success'
}
},
methods: {
checkQueryStatus: function() {
var sessionID = login();
sessionID.then(function(result) {
this.alertText = result;
});
}
}
});
The question remains, why doesn't the sessionID.then
block have access to the alertText
property?