Yeasir Arafat Majumder
Yeasir Arafat Majumder

Reputation: 1264

vee-validate error message don't have the field name

I am trying to get a hand of vee-validate 3. A lot has changed on version 3. Problem is the error messages do not have the specific field name. Below is the code that i have in a laravel blade file:

<validation-provider rules="email" v-slot="{ errors }">
<input type="text" 
class="input" 
name="email"
v-model="email">
<span>@{{ errors[0] }}</span>
</validation-provider>

When i strart typing in the input field, the error message prints inside the span tags, but it does not have the field name, rather a generic 'field', such as below:

{field} is not valid.

Anybody knows how to get this working?

Thanks,

Upvotes: 4

Views: 2268

Answers (1)

Yeasir Arafat Majumder
Yeasir Arafat Majumder

Reputation: 1264

I found it in the docs. All you need to do is add a name property to the validation-provider component like below:

<validation-provider rules="email" name="...add_input_field_name_here..." v-slot="{ errors }">

Upvotes: 7

Related Questions