Reputation: 1264
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
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