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(() => {
2121 :is =" modal.component"
2222 v-for =" (modal, index) in vfm.dynamicModals"
2323 :key =" modal.id"
24- v-bind =" modal.attrs"
24+ v-bind =" {
25+ displayDirective: modal.keepAlive ? 'show' : undefined,
26+ ...modal.attrs,
27+ }"
2528 v-model =" modal.modelValue"
2629 @closed =" () => _vfm.resolvedClosed?.(index)"
2730 @opened =" () => _vfm.resolvedOpened?.(index)"
Original file line number Diff line number Diff line change 11<script lang="ts" setup>
2+ import { ref } from ' vue'
3+
24defineProps <{
35 text: string
46}>()
@@ -8,11 +10,14 @@ const emit = defineEmits<{
810}>()
911
1012emit (' create' )
13+
14+ const count = ref (0 )
1115 </script >
1216
1317<template >
1418 <div style =" height : 500px ;" >
1519 <div >default slot component {{ text }}</div >
1620 <button >Click Button!</button >
21+ <input v-model =" count" type =" number" >
1722 </div >
1823</template >
Original file line number Diff line number Diff line change @@ -7,9 +7,10 @@ import TestModal from './TestModal.vue'
77const { toggle, closeAll } = useVfm ()
88
99const modal1 = useModal ({
10+ keepAlive: true ,
1011 component: VueFinalModal ,
1112 attrs: {
12- ' displayDirective' : ' if' ,
13+ // 'displayDirective': 'if',
1314 ' background' : ' interactive' ,
1415 ' lockScroll' : false ,
1516 ' contentStyle' : { backgroundColor: ' #fff' },
You can’t perform that action at this time.
0 commit comments