File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed
packages/vue-final-modal/src/components Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,10 @@ onBeforeUnmount(() => {
21
21
:is =" modal.component"
22
22
v-for =" (modal, index) in vfm.dynamicModals"
23
23
:key =" modal.id"
24
- v-bind =" modal.attrs"
24
+ v-bind =" {
25
+ displayDirective: modal.keepAlive ? 'show' : undefined,
26
+ ...modal.attrs,
27
+ }"
25
28
v-model =" modal.modelValue"
26
29
@closed =" () => _vfm.resolvedClosed?.(index)"
27
30
@opened =" () => _vfm.resolvedOpened?.(index)"
Original file line number Diff line number Diff line change 1
1
<script lang="ts" setup>
2
+ import { ref } from ' vue'
3
+
2
4
defineProps <{
3
5
text: string
4
6
}>()
@@ -8,11 +10,14 @@ const emit = defineEmits<{
8
10
}>()
9
11
10
12
emit (' create' )
13
+
14
+ const count = ref (0 )
11
15
</script >
12
16
13
17
<template >
14
18
<div style =" height : 500px ;" >
15
19
<div >default slot component {{ text }}</div >
16
20
<button >Click Button!</button >
21
+ <input v-model =" count" type =" number" >
17
22
</div >
18
23
</template >
Original file line number Diff line number Diff line change @@ -7,9 +7,10 @@ import TestModal from './TestModal.vue'
7
7
const { toggle, closeAll } = useVfm ()
8
8
9
9
const modal1 = useModal ({
10
+ keepAlive: true ,
10
11
component: VueFinalModal ,
11
12
attrs: {
12
- ' displayDirective' : ' if' ,
13
+ // 'displayDirective': 'if',
13
14
' background' : ' interactive' ,
14
15
' lockScroll' : false ,
15
16
' contentStyle' : { backgroundColor: ' #fff' },
You can’t perform that action at this time.
0 commit comments