Vue Slot Props? #788
Answered
by
Shyrro
jiblett1000
asked this question in
Q&A
Vue Slot Props?
#788
-
Hey there, Just wondering if slot props to expose state will become available? I know development is still pretty early on. Just curious. For example: <Select
v-model="selectedOption"
v-slot="{ isOpen }"
>
<SelectLabel>Label</SelectLabel>
<SelectTrigger>
<button>
{{ selectedOption?.label ?? "Select" }}
<ArrowDropDownIcon
:class="[
'h-6 w-6 flex-none transition-transform duration-150',
isOpen && 'rotate-180',
]"
/>
</button>
</SelectTrigger>
...
</Select> |
Beta Was this translation helpful? Give feedback.
Answered by
Shyrro
Apr 20, 2023
Replies: 1 comment 1 reply
-
Hey @jiblett1000 ! Actually yes. In other components we already expose the state, either through template refs or through slot props. As for the rest, we'll always try to expose relevant state as much possible, either through slot props or template refs! Hope that answers your question |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
jiblett1000
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @jiblett1000 !
Actually yes. In other components we already expose the state, either through template refs or through slot props.
Depends on the component, we missed the select so we'll definetly update this one 🙏
As for the rest, we'll always try to expose relevant state as much possible, either through slot props or template refs!
Hope that answers your question☺️