Question · Vue.js course · Module 8: Slots & Dynamic Components

Passing content to a named slot

How do you pass content to a named slot called 'header' in the parent?

Answer options

  • <div slot="header">Content</div>
  • <slot name="header">Content</slot>
  • <template v-slot:header>Content</template>
  • <header>Content</header>

You can check the correct answer by solving this task in the CodeWorlds game.