import { use } from '../utils'; import { inherit } from '../utils/functional'; // Types import { CreateElement, RenderContext } from 'vue/types'; import { DefaultSlots } from '../utils/use/sfc'; export type OverlayProps = { zIndex?: number; className?: any; visible?: boolean; customStyle?: object; }; export type OverlayEvents = { click(event: Event): void; }; const [sfc, bem] = use('overlay'); function Overlay( h: CreateElement, props: OverlayProps, slots: DefaultSlots, ctx: RenderContext ) { const style = { zIndex: props.zIndex, ...props.customStyle }; return (
{ event.preventDefault(); event.stopPropagation(); }} {...inherit(ctx, true)} /> ); } Overlay.props = { zIndex: Number, className: null as any, visible: Boolean, customStyle: Object }; export default sfc(Overlay);