Questions tagged [vue-slot]

Use this tag for questions about the Vue.js element or `v-slot` directive

Vue content distribution API, using the <slot> element to serve as distribution outlets for content.


Example

Parent component

<template>
  <child>
    <h1>Slot content</h1>
    <h2>This content is passed from parent to child</h2>
  </child>
</template>

Child component with <slot>

<template>
  <slot></slot>
</template>
29 questions
0
votes
2 answers

Vuejs: How to add Transition to slot content?

I have a modal component that handles the overlay and css etc. and allows for modal content to be passed in via a slot:
And it's being used like
TommyF
  • 6,660
  • 8
  • 37
  • 61
0
votes
1 answer

Vue 3: access VueComponent object placed in slots

I'm working on tab component and I want to render tab labels in parent component by getting child's slot, named 'label' In Vue 2.x I could approach that, by referring to $slots property of tab component, in Tabs.vue: