Skip to content

Commit 449764b

Browse files
committed
chore: fix recursive createVNode
1 parent ee11efe commit 449764b

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

packages/vue-final-modal/src/useVNode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { isString, objectEntries } from './utils'
1111
*/
1212
export function createVNode<T extends Component>(options: CreateVNodeOptions<T>) {
1313
const id = Symbol(__DEV__ ? 'createVNode' : '')
14-
const vNode = _h(options.component, { key: id, ...options.attrs }, options.slots)
14+
const vNode = _h(options.component, { key: id, ...options.attrs }, getSlots(options.slots))
1515
return vNode
1616
}
1717

viteplay/src/components/VueFinalModal/Basic.example.vue

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
22
import { ref } from 'vue'
3-
import { ModalsContainer, VueFinalModal, h, useModal, useVNode, useVfm } from 'vue-final-modal'
3+
import { ModalsContainer, VueFinalModal, createVNode, h, useModal, useVNode, useVfm } from 'vue-final-modal'
44
import DefaultSlot from '../DefaultSlot.vue'
55
import { modal } from './modalsHelpers'
66
import TestModal from './TestModal.vue'
@@ -80,10 +80,18 @@ function clickOutside() {
8080
// show.value = true
8181
// })
8282
83-
const { show: _show } = useVNode(h({
83+
const { show: _show } = useVNode(createVNode({
8484
component: DefaultSlot,
8585
attrs: {
86-
text: 'h',
86+
text: 'createVNode',
87+
},
88+
slots: {
89+
default: h({
90+
component: DefaultSlot,
91+
attrs: {
92+
text: '123456',
93+
},
94+
}),
8795
},
8896
// slots: {
8997
// default: h({

0 commit comments

Comments
 (0)