We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7738021 commit 9f77704Copy full SHA for 9f77704
src/plugin/index.ts
@@ -9,18 +9,17 @@ import {PromiseDialog} from "./promise.dialog";
9
10
interface DialogPluginOptions extends Omit<DialogWindowOptionsInterface, 'id'>{}
11
12
+// const injectionKey = Symbol('$dialog')
13
const DialogPlugin = {
14
install(app: App, options: DialogPluginOptions) {
- const DirectivesInstance = new DirectiveDialog(app)
15
- app.directive('confirm', DirectivesInstance.defineConfirm())
16
-
+ const directivesInstance = new DirectiveDialog(app)
17
const dialog = new PromiseDialog(app, options)
18
+ app.directive('confirm', directivesInstance.defineConfirm())
19
+ app.provide('$dialog', dialog)
20
Object.defineProperties(app.config.globalProperties, {
21
$dialog: {
- get () {
22
- return dialog
23
- }
+ get: () => dialog
24
}
25
})
26
},
0 commit comments