ano-ui
Version:
<p align="center"> <img src="https://github.com/ano-ui/ano-ui/raw/main/public/logo.svg" style="width:100px;" /> <h1 align="center">Ano-UI (WIP)</h1> <p align="center">An UniApp UI components with UnoCSS.</p> </p> <p align="center"> <a href="https://www.np
19 lines (14 loc) • 453 B
text/typescript
import type { SetupContext } from 'vue'
import { computed } from 'vue'
import { CLICK_EVENT } from '../constants'
import type { OverlayEmits, OverlayProps } from './overlay'
export function useOverlay(props: OverlayProps, emit: SetupContext<OverlayEmits>['emit']) {
const showValue = computed(() => props.show || false)
const clickHandler = (evt: MouseEvent) => {
emit(CLICK_EVENT, evt)
}
return {
showValue,
clickHandler,
}
}