I am facing an issue with Vue JS in my frontend development. Here is the data for my component -
data: () => ({
email: "",
showError : false
}),
Below is the corresponding HTML code -
<div v-show='showError' class='errorBox'>
<p>Error</p>
</div>
The problem I am encountering is that I am unable to dynamically change the value of showError in the data. Despite writing the following code, the value does not update and no error is shown in the console:
axios.get('/accounts/passwordresetpage_ajax_validation/' + '?email=' + email.value)
.then(function (res) {
if (res.data.email_does_not_exists) {
return this.showError = true
} else {
document.querySelector('form').submit()
}
});
This code snippet is contained within a component method. Any assistance on resolving this issue would be greatly appreciated.