Passing though/inheriting slots #9621
hagabaka
started this conversation in
General Discussions
Replies: 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Sometimes you want to have a component to pass all its slot content to its only child, similar to what
inheritAttrs
does with attributes. As far as I've found, ways to do this in Vue 3 are quite unwieldy and hard to remember:https://gist.github.com/loilo/73c55ed04917ecf5d682ec70a2a1b8e2?permalink_comment_id=4389210#gistcomment-4389210
What's the reason for slots being inherited not being the default behavior, like with
inheritAttrs
? Is it possible to have an option to allow a component to opt in to inheriting slots? And is it possible to provide a way to easily pass slot contents to one of multiple child components, as a counterpart tov-bind="$attrs"
?Beta Was this translation helpful? Give feedback.
All reactions