Validating fields in slots
See original GitHub issueHi there!
What an excellent lib! There’s only one more hurdle to jump before the team adopts it.
When using a slot with an input for a field, I can’t seem to get the validator to recognize the updated model. Though the validator works on another field that’s generated by the lib. I don’t expect the field in the slot to output an error, but I would expect the validator to check the model based on the schema specifications so that valid === false
.
Here’s a reproduction: https://codepen.io/joshhoegen/pen/jOMddvr
Despite being required and only accepting alpha chars, v-model="valid"
isn’t updated based off of the model…
- Is this the intended design?
- Is there a recommended way I can ensure the form’s v-model returns false?
Thanks for the lib and all the insight you share!
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Field - VeeValidate
Validates the field's current value and returns a promise that resolves with an object containing the error messages emitted by the various rule(s)....
Read more >Validate Slot Values | Alexa Skills Kit - Amazon Developer
Slot validation lets you create validation rules for your slot values. Alexa can then check ... Under slot type field, select Validations.
Read more >Validation with fields in slot - Get Help - Vue Forum
Hello, I use VeeValidate for form validation and it worked ok. But I decided to remake my editor using slot, ...
Read more >validation inside slot not working correctly in 'eager' mode ...
There are two fields here: one inside the slot in the same file as the ValidationProvider (default slot content). The second has the...
Read more >Validation of Custom Fields – Knowledge Base | RaiseNow
We are able to add custom fields but what about an opportunity to validate them. Let's try to implement a custom validation rule....
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
Otherwise you have the right starting points. The solution would be something like that:
I think that would do the trick while maintaining compatibility with the rest of the code. But I also think that using v-input is more in line with the framework.
Cool! I see that in the first example, it works in an array. Couldn’t quite figure out how to with the plain string field, however I’m enamored with the “input” use case! ❤️