Vue Composition API: Slots - bcgov/healthgateway GitHub Wiki
Class Component
get hasSlot(): boolean {
return this.$slots.default !== undefined;
}
Composition API
import { computed, useSlots } from "vue";
const slots = useSlots();
const hasSlot = computed(() => slots.default !== undefined);