[Vuejs]-Display custom message for Vee-Validate regex

0👍

I had luck with the vars {_field_} and {_value_}.
So it would look like:

extend("required", {
  ...required,
  message: "{_field_} can not be empty. ({_value_})"
});
extend("digits", {
  ...digits,
  message: "{_field_} needs to be {length} digits. ({_value_})"
});
extend("min_value", {
  ...min_value,
  message: "{_field_} needs to be at least {min}. ({_value_})"
});
extend("max_value", {
  ...max_value,
  message: "{_field_} needs to be less than {max}. ({_value_})"
});
extend("regex", {
  ...regex,
  message: "{_field_} does not match {regex}. ({_value_})"
});

Leave a comment