I Am using Vue 3 with vee-validate V4, and I am unable to get all error messages inside the script tag. Is there any way to get all error messages inside the script tag?
<Form v-slot="{ errors }">
<Field name="name" />
<pre>
{{ errors.name }}
</pre>
</Form>
How do get all errors in the script tag?
The Form
errorsonly has one error per field, no way around that. Each field has it's ownerrorswhich is an array (and you can access that inside the Field viav-slot={ errors }).You may want to call
this.$refs.form.validateField()on each field and the result for that gives you an errors array which you could save into your data to show in the template: