5.0.0 • Published 6 months ago
@frankhoodbs/slot-helper
Licence
ISC
Version
5.0.0
Deps
0
Size
5 kB
Vulns
0
Weekly
0
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')"