mirror of
https://github.com/koel/koel
synced 2024-12-29 22:13:06 +00:00
13 lines
427 B
TypeScript
13 lines
427 B
TypeScript
import { Ref } from 'vue'
|
|
import { requireInjection } from '@/utils'
|
|
import { OverlayKey } from '@/symbols'
|
|
import Overlay from '@/components/ui/Overlay.vue'
|
|
|
|
export const useOverlay = (overlay?: Ref<InstanceType<typeof Overlay>> | null) => {
|
|
overlay = overlay || requireInjection(OverlayKey)
|
|
|
|
return {
|
|
showOverlay: overlay.value.show.bind(overlay.value),
|
|
hideOverlay: overlay.value.hide.bind(overlay.value)
|
|
}
|
|
}
|