song-ui-u
Version:
vue3 + js的PC前端组件库
51 lines (47 loc) • 1.09 kB
JavaScript
;
var vue = require('vue');
var index$1 = require('../../../hook/use-namespace/index.cjs');
require('song-ui-pro-icon');
var index = require('../../../hook/use-zindex/index.cjs');
var Mask = vue.defineComponent({
name: "x-mask",
props: {
mask: {
type: Boolean,
default: true
},
maskClose: {
type: Boolean,
default: true
}
},
setup(props, { emit, slots }) {
const ns = index$1.useNamespace("mask");
const { nextZindex, currentZindex } = index.useZindex();
nextZindex();
const onClose = () => {
if (!props.maskClose) {
return;
}
emit("close");
};
return () => {
return vue.createVNode(
"div",
{
class: [ns.b()],
style: [{ zIndex: currentZindex.value }]
},
[
vue.h("span", {
class: props.mask ? ns.e("wrap") : "",
onClick: () => onClose()
}),
vue.renderSlot(slots, "default")
]
);
};
}
});
module.exports = Mask;
//# sourceMappingURL=mask.cjs.map