File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
packages/vue-final-modal/src Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ export type ModalSlot = string | Component | ModalSlotOptions
24
24
25
25
export type UseModalOptions < P > = {
26
26
defaultModelValue ?: boolean
27
- keepModalInstance ?: boolean
27
+ keepAlive ?: boolean
28
28
context ?: Vfm
29
29
component ?: Constructor < P >
30
30
attrs ?: ( RawProps & P ) | ( { } extends P ? null : never )
Original file line number Diff line number Diff line change @@ -70,10 +70,13 @@ export function useModal<P = InstanceType<typeof VueFinalModal>['$props']>(_opti
70
70
}
71
71
72
72
tryOnUnmounted ( ( ) => {
73
- if ( ! options . keepModalInstance )
73
+ if ( ! options . keepAlive )
74
74
destroy ( )
75
75
} )
76
76
77
+ if ( options . modelValue === true )
78
+ options . context ?. dynamicModals . push ( options )
79
+
77
80
function open ( ) : Promise < string > {
78
81
if ( options . modelValue )
79
82
return Promise . resolve ( '[Vue Final Modal] modal is already opened' )
@@ -92,8 +95,8 @@ export function useModal<P = InstanceType<typeof VueFinalModal>['$props']>(_opti
92
95
options . modelValue = false
93
96
return new Promise ( ( resolve ) => {
94
97
options . resolveClosed = ( ) => {
95
- console . log ( ` close options.keepModalInstance → ` , options . keepModalInstance )
96
- if ( ! options . keepModalInstance )
98
+ // console.log(' close options.keepAlive → ' , options.keepAlive )
99
+ if ( ! options . keepAlive )
97
100
destroy ( )
98
101
resolve ( 'closed' )
99
102
}
You can’t perform that action at this time.
0 commit comments