Skip to content

How to use named slots with v-slotΒ #18

@sandra0503

Description

@sandra0503

Hi there, I'm struggling to use the unified slot syntax in Vue 2.7. Reference usage here

Child component:

  setup(props, { slots }) {
    return () => <div>{slots.header}</div>
  },

Parent component:

<Child>
{{
  header: () => {
    return <div>My header</div>
  },
}}
</Child>

or

<Child v-slots={{ header: () => 'My header' }}></Child>

Is this supported?

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