From 55b470799006b52b3a00ceda02a915cb8419bd9c Mon Sep 17 00:00:00 2001 From: Lachlan Miller Date: Thu, 8 Jul 2021 10:28:08 +1000 Subject: [PATCH] lint --- src/mount.ts | 2 +- tests/mountingOptions/slots.spec.ts | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/mount.ts b/src/mount.ts index 8f7fbd302f..45d6987955 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 df1cb86c7f..cf2ec4b6f5 100644 --- a/tests/mountingOptions/slots.spec.ts +++ b/tests/mountingOptions/slots.spec.ts @@ -89,7 +89,7 @@ describe('slots', () => { '' + '
' + '
' + - '
' + + '
Hello world
' + '
' + '
' ) @@ -214,16 +214,25 @@ describe('slots', () => { const Parent = defineComponent({ mounted() { parentMounted() + }, + render() { + return h(this.$slots.default!) } }) const Child = defineComponent({ + render() { + return h('span') + }, mounted() { childMounted() } }) const wrapper = mount(Parent, { + global: { + components: { Child } + }, slots: { default: Child }