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