janriemer, Did you know that you can remove a slot from a template in #Vue, if it is not used by the parent component?
It goes something like this:
<header v-if="$slots.optionalHeader">
<slot name="optionalHeader"></slot>
</header>When "optionalHeader" slot is not used by the parent,
header
element will be removed from DOM.It requires no additional #JS at all - it's all in the template! :awesome:
Add comment