docs icon indicating copy to clipboard operation
docs copied to clipboard

Creating web components with slots and render functions

Open skirtles-code opened this issue 2 years ago • 0 comments

Vue can be used to create Web Components. The docs explain how to use slots here:

https://vuejs.org/guide/extras/web-components.html#slots

However, that explanation only holds when using a template. With a render function it is necessary to create an actual <slot> node, rather than using the usual Vue slots object. e.g.:

h('slot', { name: 'slot-name' })

This isn't currently documented.

More details in https://github.com/vuejs/core/issues/7843.

skirtles-code avatar Mar 08 '23 02:03 skirtles-code