LEARNING BY VUEING

Slot props
36 / 42

Slots can also receive props from the child component.

Here, VPage.vue binds the variable isHeaderHidden to the slot:

<slot :isHeaderHidden="isHeaderHidden".


Back in App.vue we can give the v-slot attribute a value to get access to the props: #header="slotProps".

This is a good candidate for desctructuring. Try replacing it with: #header="{ isHeaderHidden }" and access the prop directly in the if-condition.