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
2424
2525export type UseModalOptions < P > = {
2626 defaultModelValue ?: boolean
27- keepModalInstance ?: boolean
27+ keepAlive ?: boolean
2828 context ?: Vfm
2929 component ?: Constructor < P >
3030 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
7070 }
7171
7272 tryOnUnmounted ( ( ) => {
73- if ( ! options . keepModalInstance )
73+ if ( ! options . keepAlive )
7474 destroy ( )
7575 } )
7676
77+ if ( options . modelValue === true )
78+ options . context ?. dynamicModals . push ( options )
79+
7780 function open ( ) : Promise < string > {
7881 if ( options . modelValue )
7982 return Promise . resolve ( '[Vue Final Modal] modal is already opened' )
@@ -92,8 +95,8 @@ export function useModal<P = InstanceType<typeof VueFinalModal>['$props']>(_opti
9295 options . modelValue = false
9396 return new Promise ( ( resolve ) => {
9497 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 )
97100 destroy ( )
98101 resolve ( 'closed' )
99102 }
You can’t perform that action at this time.
0 commit comments