Skip to content

Commit 5b7bcdc

Browse files
Michael.KryvoruchkoMichael.Kryvoruchko
authored andcommitted
feat: add the ability to add default props for modals using the plugin
- plugin `props` option allow define default props
1 parent de658da commit 5b7bcdc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/plugin.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ export const dialogInjectionFallback: IDialog = {
5252
export const plugin: Plugin = {
5353
install: (app, options) => {
5454
const defaultCloseDelay = options?.closeDelay ?? 500
55+
// TODO make docs for this
56+
const defaultProps = options?.props ?? {}
5557

5658
const $dialog: IDialog = {
5759
dialogs,
@@ -63,6 +65,7 @@ export const plugin: Plugin = {
6365

6466
props: reactive({
6567
modelValue: true,
68+
...defaultProps,
6669
...props,
6770
}),
6871
})

0 commit comments

Comments
 (0)