From f3007a6b4f57559cf51acfe71bdacdabc9055be8 Mon Sep 17 00:00:00 2001 From: meteorlxy Date: Thu, 5 Dec 2019 01:28:52 +0800 Subject: [PATCH] fix(core): use String to convert primitive types (#518) --- packages/runtime-core/src/vnode.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/runtime-core/src/vnode.ts b/packages/runtime-core/src/vnode.ts index d09040b9..d47bf78c 100644 --- a/packages/runtime-core/src/vnode.ts +++ b/packages/runtime-core/src/vnode.ts @@ -336,7 +336,7 @@ export function normalizeVNode(child: VNodeChild): VNode { return child.el === null ? child : cloneVNode(child) } else { // primitive types - return createVNode(Text, null, child + '') + return createVNode(Text, null, String(child)) } } @@ -352,7 +352,7 @@ export function normalizeChildren(vnode: VNode, children: unknown) { children = { default: children } type = ShapeFlags.SLOTS_CHILDREN } else { - children = isString(children) ? children : children + '' + children = String(children) type = ShapeFlags.TEXT_CHILDREN } vnode.children = children as NormalizedChildren