Skip to content
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

Add scopedSlots to functional component context #5381

Closed
kaleb opened this issue Apr 5, 2017 · 2 comments
Closed

Add scopedSlots to functional component context #5381

kaleb opened this issue Apr 5, 2017 · 2 comments

Comments

@kaleb
Copy link

kaleb commented Apr 5, 2017

What problem does this feature solve?

Currently, when attempting to use scoped slots in a functional component, the slot is entirely missing in the context.slots() and context.children. Example: http://codepen.io/kaleb/pen/qrwwye?editors=1010

What does the proposed API look like?

render(h, ctx) {
  var scopedSlots = ctx.scopedSlots();
  return h('ul', ctx.props.items.map(i => h('li', {}, scopedSlots.default ? scopedSlots({value: i}) : i)));
}
@sqal
Copy link
Contributor

sqal commented Apr 5, 2017

You can access them from context.data.scopedSlots

@posva
Copy link
Member

posva commented Apr 5, 2017

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