@frankhoodbs/slot-helper
v4.0.3
Published
Simple utilities to check if a slot is available or isn't empty
Keywords
Readme
Slot helper
This is a composable used to check if a slot is available or is not empty.
Usage
import { useSlotsExtended } from '../src';
import type { VNode } from 'vue';
// Slots
const slots = defineSlots<{
default?: () => VNode[];
content?: () => VNode[];
}>();
// Composables
const { isSlotDefined, isSlotNotEmpty } = useSlotsExtended(slots);
// on the template v-if="isSlotNotEmpty('content')"