Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created June 2, 2019 16:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/7ccfa9ca40048d1fe7aa0ff3ad82cda7 to your computer and use it in GitHub Desktop.
Save parzibyte/7ccfa9ca40048d1fe7aa0ff3ad82cda7 to your computer and use it in GitHub Desktop.
VeeValidate.Validator.extend('prohibirPalabras', {
getMessage: (campo, argumentos) => {
// argumentos es un arreglo
return "El campo " + campo + " no puede contener las siguientes palabras: " + argumentos.join(" ");
},
validate: (valor, argumentos) => {
return argumentos.every(argumento => !valor.includes(argumento))
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment