Issue with email validation using regex in Vue.js
<div class="input-wrapper">
<div class="email-icon"></div>
<input type="email" v-model.trim="$v.email.$model"
v-validate="'required'"
:class="{ 'is-invalid': validationStatus($v.email) }"
name="email" class=" input-section"
placeholder="Enter your company email ID"
:maxlength="maxemail"
v-on:keypress="validEmail($event)"
id='email' v-model='email' />
<div v-if="!$v.email.required" class="invalid-feedback">
The email field is required.</div>
<div v-if="!$v.email.maxLength" class="invalid-feedback-register">
30 characters only {{ $v.user.password.$params.maxLength.min }} </div>
</div>
I have encountered an issue while implementing the email validation with regex in Vue.js and so far I have not been able to resolve it.
I need the email field to be mandatory and check for domain names, for example:- [email protected]. I have attempted to implement a keypress event but I am facing difficulties passing the regex as suggested in the provided link.