We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
2.6.11
https://github.com/Xie-Jay/slot-issue
I show issue by console.
All vnode can get componentInstance property.
ComponentInstance property is undefined when using the v-slot directive, but others not.
<slot-test> <component-test slot="default" name="slot1"></component-test> </slot-test> <slot-test> <template slot="default"> <component-test name="slot2"></component-test> </template> </slot-test> <slot-test> <template v-slot:default> <component-test name="slot3"></component-test> </template> </slot-test>
When I use v-slot to replace slot, I get this diffrence which really confuse me.
The text was updated successfully, but these errors were encountered:
I'm not sure you are supposed to use componentInstance from the returned vnode. You can still get the component instance through $children[0]
componentInstance
$children[0]
Sorry, something went wrong.
It's useful for me to build component that need control components in slot by using componentInstance.
I tried to use $children, it's ok when just one slot.
$children
But more than one, like this:
<div> <slot /> <slot name="expand" /> </div>
It will be difficult to separate these components in slot by using $children.
In fact, I have no idea except that provide extra prop to distinguish them, because there’s no order guarantee for $children.
prop
@rubys @rubys @rubys @rubys 666
No branches or pull requests
Version
2.6.11
Reproduction link
https://github.com/Xie-Jay/slot-issue
Steps to reproduce
I show issue by console.
What is expected?
All vnode can get componentInstance property.
What is actually happening?
ComponentInstance property is undefined when using the v-slot directive, but others not.
When I use v-slot to replace slot, I get this diffrence which really confuse me.
The text was updated successfully, but these errors were encountered: