v-slot (#) Slot Content Directive
Last updated: 2026-10-22
v-slot (#) Slot Content Directive
v-slot declares slot content, shorthand #. It passes template fragments into a child component's named or scoped slots.
| Group | Directives |
|---|---|
| Kind | Directive |
| Scope | Template |
| Vue Version | 3.0+ |
| SSR Support | Yes |
📝 Syntax
<template v-slot:header>...</template>
<template #default="{ item }">...</template>
<Child v-slot="{ data }">
⚙️ Arguments
| expression | Slot name (omitted for the default slot); scoped slots destructure child-provided data |
|---|
Returns:Directive, no return value
▶ Example
Edit the code below and see the live result:
Output:
The page shows a bold 'Custom header' — parent content replaced the slot default.
💡 Key Points
💡 Tip # is shorthand for v-slot: — #header equals v-slot:header.
⚠️ Warning v-slot works only on or component tags, never on plain elements.
ℹ️ Note Scoped slots hand child data to the parent (#default="{ item }") — the key mechanism for custom list rendering.
🏷️ Related Directives
💡 Related Cases
More case studies coming soon.
📚 Related Tutorials
❓ FAQ
Q Is # the same as v-slot:?
A Exactly equivalent; bare v-slot means the default slot.
Q What is a scoped slot?
A The child passes data out via slot props (e.g. #default="{ item }"), enabling custom list rendering.
Q Can v-slot sit on a plain element?
A No — only on <template> or a component tag, the most common error source.