Slots parent کو template content کو child component میں منتقل کرنے دیتے ہیں — یہ flexible، reusable wrappers (cards, modals, layouts) بنانے کا طریقہ ہے جہاں consumer اندرونی markup کو کنٹرول کرتا ہے۔
بنیادی slot
<!-- Card.vue -->
<template>
<div class="card">
<slot></slot> <!-- parent's content is injected here -->
</div>
</template>
<!-- parent -->
<Card>
<h2>Title</h2> <!-- this markup fills the slot -->
<p>Any content!</p>
</Card>
Child ایک "hole" () کو define کرتا ہے؛ parent اسے جو بھی markup چاہے اس سے بھرتا ہے۔ یہ props کے ذریعے strings منتقل کرنے سے بہت زیادہ flexible ہے۔
