1๐
I think you are looking for Vuelidate
. To explain in brief, you can import Vuelidate in your project and the built-in validators.
import { email, required } from 'vuelidate/lib/validators'
export default {
validations: {
email: {
email,
required
}
}
}
Once you import Vuelidate
in your project, it makes a validations object available with which you can specify the validation mappings. These mappings are available in the template via $v
and can be updated on events as
<input type="text" placeholder="Email" v-model="data.email" @blur="$v.email.$touch()">
This is just the beginning and you should learn more from online sources.
๐คSaksham
- [Vuejs]-How do i dynamically generate vue components from wordpress custom fields
- [Vuejs]-Vue will not communicate with Express through NGINX
Source:stackexchange.com