Video Thumbnail

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

UNLOCK LESSON

Premium Features

Download Video

23. Frontend Validation - Part 2

Published 5 years 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

Login
davelivesey posted 4 years ago
0
chris posted 4 years ago
0
chris posted 4 years ago
0

Providing the lift to launch your development career

© 2024 Chris Courses. All rights reserved.