Video Thumbnail

Sign up for a plan to instantly unlock all premium lessons.

23. Frontend Validation - Part 2

Published 7 months ago

vee-validate.js
import Vue from 'vue'
import {
  ValidationProvider,
  ValidationObserver,
  extend,
  localize
} from 'vee-validate'
import { required, min, email } from 'vee-validate/dist/rules'

localize({
  en: {
    messages: {
      required: (name) => `${name} field is required`,
      email: (name) => `Please use a valid email address`,
      min: (name, { length }) =>
        `${name} field must have ${length} characters or more`
    }
  }
})

extend('min', min)
extend('email', email)
extend('required', required)

Vue.component('ValidationProvider', ValidationProvider)
Vue.component('ValidationObserver', ValidationObserver)

Comments

Want to participate?

Create a free Chris Courses account to begin

or
Sign In
davelivesey posted 3 months ago
0
chris posted 2 months ago
0
chris posted 2 months ago
0
Cheat Sheet Preview

Download The Official Chris Courses HTML5 Canvas Cheat Sheet

Essential canvas syntax at your fingertips.

Download Now

Providing the lift to launch your development career

© 2021 Chris Courses. All rights reserved.