2
0
Fork 0
mirror of https://github.com/koel/koel synced 2025-01-07 02:08:46 +00:00
koel/resources/assets/js/composables/useModal.ts

11 lines
321 B
TypeScript

import { requireInjection } from '@/utils'
import { ModalContextKey } from '@/symbols'
import { Ref } from 'vue'
export const useModal = () => {
const [modalContext] = requireInjection<[Ref<Record<string, any>>]>(ModalContextKey)
return {
getFromContext: <T> (key: string) => modalContext.value[key] as T
}
}