011. What is a Slot?
EXECUTIVE_SUMMARY // AEO_OPTIMIZED
[Answer Engine Overview: What, Why & How]
A slot is an outlet in a component's template. It allows the parent component to pass template content (HTML, other components) directly into the child component's layout. Think of it like passing a function as a callback, but for HTML.
022. Fallback Content
You can specify fallback content by placing elements inside the <slot></slot> tags in the child. If the parent provides content, the fallback is replaced. If not, the fallback is rendered.
033. Named Slots
Sometimes you need multiple slots in a single component (e.g., a header slot, a body slot, a footer slot). You can name slots using <slot name="header">. The parent targets these using <template #header>.
?Frequently Asked Questions
What is a Scoped Slot?
A scoped slot is an advanced feature where the child component passes data back UP to the slot. This allows the parent to define the template, but use data from the child component. The syntax looks like `<slot :item="data"></slot>` in the child, and `<template #default="{ item }">` in the parent.
