Last active
June 30, 2022 20:25
-
-
Save cn-2k/e7478c1b83e1e92d0937fc48675228c5 to your computer and use it in GitHub Desktop.
Check if a named slot is empty in VueJS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<nav | |
v-if="slots.myNamedSlot" | |
> | |
<slot name="myNamedSlot" /> | |
</nav> | |
</div> | |
</template> | |
<script setup> | |
import { useSlots } from 'vue' | |
const slots = useSlots() | |
</script> | |
<style> | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment