Skip to content

Slots syntax in slots-unification is wrong #366

Closed
@cathrinevaage

Description

@cathrinevaage

In guide/migration/slots-unification, the syntax for passing slots to a component is incorrect.
RawSlots is not part of props, the second parameter in the used h overload, but part of third parameter children.
The syntax is correctly documented elsewhere: guide/render-function.

Suggested edit:

## 3.x Syntax

- In 3.x, render functions will have a `slots` option where they can be defined instead.
+ In 3.x, render functions can take an object of `slots` as the `children` parameter instead.

```js
// 3.x Syntax
- h(LayoutComponent, {
-   slots: {
-     header: () => h('div', this.header),
-     content: () => h('div', this.content)
-   }
+ h(LayoutComponent, {}, {
+   header: () => h('div', this.header),
+   content: () => h('div', this.content)
+ })
```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions