mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-17 05:28:09 +01:00
feat(Modal): open programmatically (#1319)
This commit is contained in:
13
src/runtime/plugins/modals.ts
Normal file
13
src/runtime/plugins/modals.ts
Normal 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)
|
||||
})
|
||||
Reference in New Issue
Block a user