Slotted content
Slotted content allows you to build flexible and reusable components by enabling users to insert their own content into specified areas of your component.
Defining Slots in Components
Example
<template>
<header>
<slot name="header">Default Header</slot>
</header>
<main>
<slot>Default Content</slot>
</main>
<footer>
<slot name="footer">Default Footer</slot>
</footer>
</template>Using Slots in Parent Components
Default Slot Content
Example
Multiple Slot Projections
Last updated
Was this helpful?