Compound component with passing props #12955
Unanswered
LadIQe
asked this question in
Help/Questions
Replies: 1 comment
-
You can solve this using scoped slots: Playground |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I hope I used right term in title, if not, Im sorry.
My question is: lets say, I have FieldWrapper component. This component has some props (like ID for "for" label, label text, hint, required, disabled, etc). So basically its simple wrapper around actual input. Because it doesnt care about what kind of input you use, you dont need to create component for every input, selector, checkbox, etc. You just wrap them.
So basic implementation is like this (just example)
And you will use it like this
What should FieldWrapper internally do:
Is it possible to create it using script setup or I need to use defineComponent with return () => ... ??
Thanks
Beta Was this translation helpful? Give feedback.
All reactions