Skip to content

Commit ac5bd53

Browse files
committed
refactor(CModal): Non-function value encountered for default slot
1 parent 4791934 commit ac5bd53

File tree

1 file changed

+23
-24
lines changed

1 file changed

+23
-24
lines changed

src/components/modal/CModal.ts

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -193,43 +193,42 @@ const CModal = defineComponent({
193193
onLeave: (el, done) => handleLeave(el, done),
194194
onAfterLeave: (el) => handleAfterLeave(el),
195195
},
196-
[
196+
() =>
197197
props.visible &&
198+
h(
199+
'div',
200+
{
201+
class: [
202+
'modal',
203+
{
204+
['fade']: props.transition,
205+
},
206+
attrs.class,
207+
],
208+
ref: modalRef,
209+
},
198210
h(
199211
'div',
200212
{
201213
class: [
202-
'modal',
214+
'modal-dialog',
203215
{
204-
['fade']: props.transition,
216+
'modal-dialog-centered': props.alignment === 'center',
217+
[`modal-fullscreen-${props.fullscreen}-down`]:
218+
props.fullscreen && typeof props.fullscreen === 'string',
219+
'modal-fullscreen': props.fullscreen && typeof props.fullscreen === 'boolean',
220+
['modal-dialog-scrollable']: props.scrollable,
221+
[`modal-${props.size}`]: props.size,
205222
},
206-
attrs.class,
207223
],
208-
ref: modalRef,
209224
},
210225
h(
211226
'div',
212-
{
213-
class: [
214-
'modal-dialog',
215-
{
216-
'modal-dialog-centered': props.alignment === 'center',
217-
[`modal-fullscreen-${props.fullscreen}-down`]:
218-
props.fullscreen && typeof props.fullscreen === 'string',
219-
'modal-fullscreen': props.fullscreen && typeof props.fullscreen === 'boolean',
220-
['modal-dialog-scrollable']: props.scrollable,
221-
[`modal-${props.size}`]: props.size,
222-
},
223-
],
224-
},
225-
h(
226-
'div',
227-
{ class: ['modal-content', props.className], ref: modalContentRef },
228-
slots.default && slots.default(),
229-
),
227+
{ class: ['modal-content', props.className], ref: modalContentRef },
228+
slots.default && slots.default(),
230229
),
231230
),
232-
],
231+
),
233232
),
234233
props.backdrop &&
235234
h(CBackdrop, {

0 commit comments

Comments
 (0)