UNPKG

song-ui-u

Version:

vue3 + js的PC前端组件库

49 lines (46 loc) 1.1 kB
import { defineComponent, createVNode, h, renderSlot } from 'vue'; import { useNamespace } from '../../../hook/use-namespace/index.mjs'; import 'song-ui-pro-icon'; import { useZindex } from '../../../hook/use-zindex/index.mjs'; var Mask = defineComponent({ name: "x-mask", props: { mask: { type: Boolean, default: true }, maskClose: { type: Boolean, default: true } }, setup(props, { emit, slots }) { const ns = useNamespace("mask"); const { nextZindex, currentZindex } = useZindex(); nextZindex(); const onClose = () => { if (!props.maskClose) { return; } emit("close"); }; return () => { return createVNode( "div", { class: [ns.b()], style: [{ zIndex: currentZindex.value }] }, [ h("span", { class: props.mask ? ns.e("wrap") : "", onClick: () => onClose() }), renderSlot(slots, "default") ] ); }; } }); export { Mask as default }; //# sourceMappingURL=mask.mjs.map