2
2
<teleport to =" body" >
3
3
<b-transition
4
4
:no-fade =" true"
5
- enter-to-class = " show"
5
+ :trans-props = " {enterToClass: ' show'} "
6
6
@before-enter =" onBeforeEnter"
7
7
@after-enter =" onAfterEnter"
8
8
@before-leave =" onBeforeLeave"
9
+ @leave =" onLeave"
9
10
@after-leave =" onAfterLeave"
10
11
>
11
12
<div
14
15
ref =" element"
15
16
class =" modal"
16
17
:class =" modalClasses"
17
- style =" display : block "
18
+ : style =" { display: ' block'} "
18
19
tabindex =" -1"
19
20
v-bind =" $attrs"
20
21
@keyup.esc =" onEsc"
21
22
>
22
23
<div class =" modal-dialog" :class =" modalDialogClasses" >
23
- <div v-if = " renderLazy " class =" modal-content" :class =" contentClass" >
24
+ <div class =" modal-content" :class =" contentClass" >
24
25
<div v-if =" !hideHeaderBoolean" class =" modal-header" :class =" headerClasses" >
25
26
<slot name =" header" >
26
27
<component :is =" titleTag" class =" modal-title" :class =" titleClasses" >
@@ -191,10 +192,12 @@ const emit = defineEmits<BModalEmits>()
191
192
192
193
const slots = useSlots ()
193
194
195
+ const isActive = ref (false )
196
+
194
197
const computedId = useId (toRef (props , ' id' ), ' modal' )
195
198
196
199
const busyBoolean = useBooleanish (toRef (props , ' busy' ))
197
- const lazyBoolean = useBooleanish (toRef (props , ' lazy' ))
200
+ // const lazyBoolean = useBooleanish(toRef(props, 'lazy'))
198
201
const cancelDisabledBoolean = useBooleanish (toRef (props , ' cancelDisabled' ))
199
202
const centeredBoolean = useBooleanish (toRef (props , ' centered' ))
200
203
const hideBackdropBoolean = useBooleanish (toRef (props , ' hideBackdrop' ))
@@ -212,12 +215,12 @@ const scrollableBoolean = useBooleanish(toRef(props, 'scrollable'))
212
215
const titleSrOnlyBoolean = useBooleanish (toRef (props , ' titleSrOnly' ))
213
216
214
217
const element = ref <HTMLElement | null >(null )
215
- const lazyLoadCompleted = ref (false )
216
218
217
219
const modalClasses = computed (() => [
218
220
props .modalClass ,
219
221
{
220
222
fade: ! noFadeBoolean .value ,
223
+ show: isActive .value ,
221
224
},
222
225
])
223
226
@@ -268,12 +271,6 @@ const titleClasses = computed(() => [
268
271
])
269
272
const disableCancel = computed <boolean >(() => cancelDisabledBoolean .value || busyBoolean .value )
270
273
const disableOk = computed <boolean >(() => okDisabledBoolean .value || busyBoolean .value )
271
- const renderLazy = computed (
272
- () =>
273
- ! lazyBoolean .value ||
274
- (lazyBoolean .value && lazyLoadCompleted .value ) ||
275
- (lazyBoolean .value && modelValueBoolean .value )
276
- )
277
274
278
275
const hide = () => emit (' update:modelValue' , false )
279
276
@@ -284,8 +281,14 @@ const onEsc = (e: KeyboardEvent) => {
284
281
}
285
282
286
283
const onBeforeEnter = () => emit (' show' )
287
- const onAfterEnter = () => emit (' shown' )
284
+ const onAfterEnter = () => {
285
+ isActive .value = true
286
+ emit (' shown' )
287
+ }
288
288
const onBeforeLeave = () => emit (' hide' )
289
+ const onLeave = () => {
290
+ isActive .value = false
291
+ }
289
292
const onAfterLeave = () => emit (' hidden' )
290
293
291
294
watch (
0 commit comments