Skip to content

get parameters from rule in custom message #3360

Answered by TylerMRoderick
lumos94 asked this question in Q&A
Discussion options

You must be logged in to vote

Adding an argument placeholder that matches the rule parameter could work here.

something like this:

extend('max', {
    ...max,
    params: ['max'],
    message: 'The {_field_} should not be more than {max} characters',
  });

Docs: https://vee-validate.logaretm.com/v3/guide/basics.html#arguments-placeholders

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by lumos94
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants