diff --git a/src/mount.ts b/src/mount.ts index 8f7fbd302..45d698795 100644 --- a/src/mount.ts +++ b/src/mount.ts @@ -263,7 +263,7 @@ export function mount( function slotToFunction(slot: Slot) { if (typeof slot === 'object') { if ('render' in slot && slot.render) { - return slot.render + return () => h(slot) } if ('template' in slot && slot.template) { diff --git a/tests/mountingOptions/slots.spec.ts b/tests/mountingOptions/slots.spec.ts index 8cf3de3c8..cf2ec4b6f 100644 --- a/tests/mountingOptions/slots.spec.ts +++ b/tests/mountingOptions/slots.spec.ts @@ -1,6 +1,6 @@ -import { h } from 'vue' +import { defineComponent, h } from 'vue' -import { mount } from '../../src' +import { flushPromises, mount } from '../../src' import Hello from '../components/Hello.vue' import WithProps from '../components/WithProps.vue' import ComponentWithSlots from '../components/ComponentWithSlots.vue' @@ -89,7 +89,7 @@ describe('slots', () => { '' + '