From ceab0b71d0dd8247220564b2a651f7bea0a796d6 Mon Sep 17 00:00:00 2001 From: Evan You Date: Wed, 12 Oct 2016 13:31:39 -0400 Subject: [PATCH] fix functional components that return string or nothing (fix #3919) --- src/core/vdom/create-component.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/core/vdom/create-component.js b/src/core/vdom/create-component.js index 0a2721cb..44f7975b 100644 --- a/src/core/vdom/create-component.js +++ b/src/core/vdom/create-component.js @@ -113,9 +113,11 @@ function createFunctionalComponent ( slots: () => resolveSlots(children, context) } ) - vnode.functionalContext = context - if (data.slot) { - (vnode.data || (vnode.data = {})).slot = data.slot + if (vnode instanceof VNode) { + vnode.functionalContext = context + if (data.slot) { + (vnode.data || (vnode.data = {})).slot = data.slot + } } return vnode }