feat(Modal): open programmatically (#1319)

This commit is contained in:
Neil Richter
2024-02-07 16:53:17 +01:00
committed by GitHub
parent 98a2d0f1af
commit 6f29c620ab
11 changed files with 168 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
import { defineNuxtPlugin } from '#imports'
import { shallowRef } from 'vue'
import { modalInjectionKey } from '../composables/useModal'
import type { ModalState } from '../types/modal'
export default defineNuxtPlugin((nuxtApp) => {
const modalState = shallowRef<ModalState>({
component: 'div',
props: {}
})
nuxtApp.vueApp.provide(modalInjectionKey, modalState)
})