March 2018
Beginner to intermediate
344 pages
7h 7m
English
When creating user accounts, passwords tend to be entered twice and conform to a minimum length. Let's add another field and some more validation rules to enforce this:
import { required, email, minLength, sameAs } from 'vuelidate/lib/validators';export default { // Omitted data() { return { email: '', password: '', repeatPassword: '', firstName: '', lastName: '', }; }, validations: { email: { required, email, }, firstName: { required, }, lastName: { required, }, password: { required, minLength: minLength(6), }, repeatPassword: { required, minLength: minLength(6), sameAsPassword: sameAs('password'), }, },}
We've done the following:
Read now
Unlock full access