How to use the vee-validate.extend function in vee-validate

To help you get started, we’ve selected a few vee-validate examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dreamvo / gilfoyle / dashboard / ui / src / plugins / vee-validate.ts View on Github external
extend("min", {
  ...min,
  message: "Veuillez saisir au moins {length} caractères"
});

extend("max", {
  ...max,
  message: "Veuillez ne pas dépasser {length} caractères"
});

extend("email", {
  ...email,
  message: "Veuillez saisir une adresse email valide"
});

extend("min_value", {
  ...MinValue,
  message: "Ce champs doit être supérieur à {min}"
});

extend("max_value", {
  ...MaxValue,
  message: "Ce champs doit être inférieur à {max}"
});

extend("confirmedBy", {
  params: ["target"],
  // Target here is the value of the target field
  validate(value, { target }: any) {
    return value === target;
  },
  // here it is its name, because we are generating a message
github dreamvo / gilfoyle / dashboard / ui / src / plugins / vee-validate.ts View on Github external
},
  // here it is its name, because we are generating a message
  message: "Ce champs doit être identique au champs {target}"
});

extend("ext", {
  ...ext,
  message: "Ce type de fichier n'est pas supporté"
});

extend("size", {
  ...size,
  message: "Ce fichier dépasse la taille maximale autorisée : {size} kB"
});

extend("integer", {
  ...integer,
  message: "Ce champs ne doit contenir qu'un nombre entier"
});

extend("regex", {
  ...regex,
  message: "Le format de ce champs est incorrect"
});
github PECE-project / drupal-pece / src / front / plugins / vee-validate.js View on Github external
import { extend } from 'vee-validate'
import { confirmed, email, max, min, numeric, required } from 'vee-validate/dist/rules'

extend('email', email)
extend('max', max)
extend('min', min)
extend('numeric', numeric)
extend('required', required)
extend('confirmed', confirmed)

extend('username', {
  message: field => 'The ' + field + ' value is not valid.',
  validate: value => /^[\w\d\-_']+$/g.test(value)
})
github vuefront / wordpress / view / javascript / d_pax / plugins / VeeValidate.js View on Github external
import Vue from 'vue'
import { ValidationProvider, extend, ValidationObserver } from 'vee-validate'
import { required, email, min, max, numeric, confirmed } from 'vee-validate/dist/rules'
import isDecimal from 'validator/lib/isDecimal'

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

extend('email', email)
extend('required', required)
extend('min', min)
extend('max', max)
extend('numeric', numeric)
extend('confirmed', confirmed)
extend('decimal', {
  validate: val => isDecimal(val.toString()),
  message: 'Please enter a valid number'
})
github dreamvo / gilfoyle / dashboard / ui / src / plugins / vee-validate.ts View on Github external
extend("required", {
  ...required,
  message: "That field is required"
});

extend("min", {
  ...min,
  message: "Veuillez saisir au moins {length} caractères"
});

extend("max", {
  ...max,
  message: "Veuillez ne pas dépasser {length} caractères"
});

extend("email", {
  ...email,
  message: "Veuillez saisir une adresse email valide"
});

extend("min_value", {
  ...MinValue,
  message: "Ce champs doit être supérieur à {min}"
});

extend("max_value", {
  ...MaxValue,
  message: "Ce champs doit être inférieur à {max}"
});

extend("confirmedBy", {
  params: ["target"],
github dreamvo / gilfoyle / dashboard / ui / src / plugins / vee-validate.ts View on Github external
extend("ext", {
  ...ext,
  message: "Ce type de fichier n'est pas supporté"
});

extend("size", {
  ...size,
  message: "Ce fichier dépasse la taille maximale autorisée : {size} kB"
});

extend("integer", {
  ...integer,
  message: "Ce champs ne doit contenir qu'un nombre entier"
});

extend("regex", {
  ...regex,
  message: "Le format de ce champs est incorrect"
});
github vuefront / wordpress / view / javascript / d_pax / plugins / VeeValidate.js View on Github external
import Vue from 'vue'
import { ValidationProvider, extend, ValidationObserver } from 'vee-validate'
import { required, email, min, max, numeric, confirmed } from 'vee-validate/dist/rules'
import isDecimal from 'validator/lib/isDecimal'

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

extend('email', email)
extend('required', required)
extend('min', min)
extend('max', max)
extend('numeric', numeric)
extend('confirmed', confirmed)
extend('decimal', {
  validate: val => isDecimal(val.toString()),
  message: 'Please enter a valid number'
})
github dreamvo / gilfoyle / dashboard / ui / src / plugins / vee-validate.ts View on Github external
size,
  integer,
  regex
} from "vee-validate/dist/rules";

extend("required", {
  ...required,
  message: "That field is required"
});

extend("min", {
  ...min,
  message: "Veuillez saisir au moins {length} caractères"
});

extend("max", {
  ...max,
  message: "Veuillez ne pas dépasser {length} caractères"
});

extend("email", {
  ...email,
  message: "Veuillez saisir une adresse email valide"
});

extend("min_value", {
  ...MinValue,
  message: "Ce champs doit être supérieur à {min}"
});

extend("max_value", {
  ...MaxValue,
github vuefront / wordpress / view / javascript / d_pax / plugins / VeeValidate.js View on Github external
import Vue from 'vue'
import { ValidationProvider, extend, ValidationObserver } from 'vee-validate'
import { required, email, min, max, numeric, confirmed } from 'vee-validate/dist/rules'
import isDecimal from 'validator/lib/isDecimal'

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

extend('email', email)
extend('required', required)
extend('min', min)
extend('max', max)
extend('numeric', numeric)
extend('confirmed', confirmed)
extend('decimal', {
  validate: val => isDecimal(val.toString()),
  message: 'Please enter a valid number'
})