feat(Modal): open programmatically (#78)

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
Neil Richter
2024-05-28 17:14:13 +02:00
committed by GitHub
parent cf38e7ed78
commit 2bf99e1eb4
8 changed files with 146 additions and 1 deletions

View File

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