8000 Cannot pass slot object into a component · Issue #10111 · vuejs/vue · GitHub
[go: up one dir, main page]

Skip to content

Cannot pass slot object into a component #10111

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

Closed
eakarpov opened this issue Jun 6, 2019 · 8 comments
Closed

Cannot pass slot object into a component #10111

eakarpov opened this issue Jun 6, 2019 · 8 comments

Comments

@eakarpov
Copy link
eakarpov commented Jun 6, 2019

Version

2.6.10

Reproduction link

https://codesandbox.io/embed/vue-template-qwq83

Steps to reproduce

Create a component, pass children via slots property.

What is expected?

this.$slots property contains the passed children inside the component

What is actually happening?

Passing via prop interface leads to empty object in this.$slots


Trying to use render function to pass blocks of template inside a component.

@posva
Copy link
Member
posva commented Jun 6, 2019

That never worked
There was something similar dropped in the past #7765

@posva posva closed this as completed Jun 6, 2019
@eakarpov
Copy link
Author
eakarpov commented Jun 6, 2019

@posva And how can I pass slot content into the component from somewhere outside? (Dynamically add slot content)

@Justineo
Copy link
Member
Justineo commented Jun 6, 2019

@eakarpov You can use a render function where you can programmatically specify slot content.

@eakarpov
Copy link
Author
eakarpov commented Jun 6, 2019

@Justineo Please could you describe API for specifying this programmatically?

@Justineo
Copy link
Member
Justineo commented Jun 6, 2019

@eakarpov
Copy link
Author
eakarpov commented Jun 6, 2019

@Justineo Thanks! Is not $scopedSlots deprecated in vue 2.6 with slot/slot-scope?

@Justineo
Copy link
Member
Justineo commented Jun 6, 2019

No it's not. We'll deprecate it in v3.

@eakarpov
Copy link
Author
eakarpov commented Jun 6, 2019

@Justineo Ok thanks. Will vue v3 be able to manage slots programmatically?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
0