-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add componentField
to Field's slot
#4270
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a really nice feature and aligns well with the defineComponentBinds
API introduced in 4.9
. I am happy to merge it but could we have a few tests for it? Let me know if you need guidance, I can add the tests later if you don't have the time.
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## main #4270 +/- ##
=======================================
Coverage 98.10% 98.11%
=======================================
Files 73 73
Lines 5753 5777 +24
Branches 1092 1095 +3
=======================================
+ Hits 5644 5668 +24
Misses 109 109
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Cool! I reused the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks a lot.
This should be documented, I could not see this in the documentation and I found it by accident by logging the slot props. I need this because one doesn't have access to defineComponentBinds in a subcomponent nested beneath the component that calls useForm() In my case the component where I need this is the great grandchild of the component that calls useForm() Is there otherwise a way to use defineComponentBinds in a sub component that I just don't know about? (besides passing the function down as prop) |
Edit: Found it documented here: https://vee-validate.logaretm.com/v4/api/field/#componentfield |
🔎 Overview
This PR adds an ability to easily bind all useful props to complex components, same as it currently works with native elements.
🤓 Code snippets/examples (if applicable)
I was looking for such feature, as it's a bit tedious and too verbose binding all props / listeners to custom components manually. Probably there is already an easy solution that I've missed?