-
Notifications
You must be signed in to change notification settings - Fork 669
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
[WIP] Fix named functional text slots #734
[WIP] Fix named functional text slots #734
Conversation
I've looked into template compilation with If you want to achieve the same in template mode (without a render function), you'd do:
This will be compiled to
So we could leverage the |
Yes we could use _v, but it would be better if we could construct with h. |
We could compile the slot using that template:
|
Nice idea but I've realized that we can use neither
I've tried it with text only but this also fails:
|
Ok, we could render it in a parent div, then use the child vNode when we call
|
@manniL did you try the suggested approach ^^ |
@eddyerburgh Not yet. Will look into it in the next days! |
After thinking about this, I don't think we should add this feature. Since named slots cannot take root text nodes, we shouldn't support them. Instead you can wrap them in a template: mount(TestComponent, {
slots: {
footer: '<template>hey</template>'
}
}) |
After #733, default text-slots work quite well. But named slots are awkwardly merged in the default slot variable. I'm working on a fix.