I am using Vue JS as my frontend. I have encountered a problem.
This is my component data -
data: () => ({
email: "",
showError : false
}),
And this is the html -
<div v-show='showError' class='errorBox'>
<p>Error</p>
</div>
I am not able to change the showError in the data dynamically. I am writing the code to change the value something like this but it does not change and does not show any error 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 piece of code is inside a component method. Someone please help