Pass errors to custom input components
See original GitHub issueVersions:
- VueJs: 2.1.0
- Vee-Validate: 2.0
Description:
In the documentation section ‘Component Validation’, one has to pass the errors as attributes to the custom input component:
<custom-input v-validate="'required|email'" data-vv-value-path="innerValue" data-vv-name="custom" label="Email" :has-error="errors.has('custom')"></custom-input>
This can get quite verbose if one wants to also have the error message.
Would it be reasonable to have the errors passed directly to the component ?
Steps To Reproduce:
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Building reusable form input component with error handling in ...
In this article I have used reactstrap for design and you will come to know how to make common form input component and...
Read more >Custom input component has required error even after being ...
I've created a custom input component by implementing the ControlValueAccessor interface. Then, I put it on a form with required validation by ...
Read more >REACT NATIVE CUSTOM INPUT AND INPUT VALIDATION
Hi, guys in this video we will look at custom input, input validation, and user authentication in react native.Please if you like this...
Read more >Lesson 15: Handling Error Messages with a Custom Component
We will be creating a custom component that we will pass the FormControl into, and it will automatically display any necessary errors for...
Read more >Error handling | Vue Formulate ⚡️ The easiest way to build ...
We already know from the inputs documentation that there are error and errors props available on all input elements. ... These error props...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I found a simple way around the problem. I simply pass the validation rules as a prop named ‘validation’
FormText.vue
In the parent component:
This seems to do the trick
this certainly isn’t working