maz-ui
Version:
A standalone components library for Vue.Js 3 & Nuxt.Js 3
1 lines • 359 B
JavaScript
import{Comment,Fragment,Text}from"vue";function hasSlotContent(slot){if(!slot)return!1;try{return hasContent(slot())}catch{return!0}}function hasContent(vnodes){return vnodes.some(node=>node.type===Comment?!1:node.type===Text?!!node.children?.trim():node.type===Fragment?Array.isArray(node.children)&&hasContent(node.children):!0)}export{hasSlotContent as t};