question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

2.0 docs-- missing "slot" option on render function's data object

See original GitHub issue

Referring to this part of the doc: http://vuejs.org/guide/render-function.html#The-Data-Object-In-Depth

When writing a render function, if you want to pass something in a named slot to a component, you have to write something like this:

createElement(component, { }, 
  createElement('div', {
    slot: 'some-named-slot'
  }, [ <some content> ])
);

Currently, the documentation for createElement’s data object doesn’t mention the slot field.

CC: @chrisvfritz

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
LinusBorgcommented, Oct 3, 2016

Sure, you can. Vue 2.0 offers both ways

0reactions
asselincommented, Oct 3, 2016

@Shmasya In my case, I needed to write a render function to have more control than a template could provide. The beginning of the page on render functions (http://vuejs.org/guide/render-function.html) provides an example of why you might want to write one vs use a template.

@LinusBorg I’ll go ahead and open an issue against the vuejs.org repo per Evan

Read more comments on GitHub >

github_iconTop Results From Across the Web

2.0 docs-- missing "slot" option on render function's data ...
Reopening issue vuejs/vue#3841 against the vuejs.org repo per Evan. ... When writing a render function, if you want to pass something in a...
Read more >
Render Functions & JSX | Vue.js
Slot functions can return anything a normal render function can return - which will always be normalized to arrays of vnodes when accessed...
Read more >
Explaining the Vue Context Argument - A Composition API ...
In this article, we'll be taking a look at the setup function's context ... context.slots – an object with all of our template...
Read more >
Vue render function - non-scoped slot - Stack Overflow
If you work with render functions, it is now recommended to always access slots via $scopedSlots , whether they currently use a scope...
Read more >
Phoenix.Component — Phoenix LiveView v0.18.3 - HexDocs
The example above uses the default slot, accessible as an assign named @inner_block , to render HEEx content via the render_slot/2 function. If...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found