From 53463619e5d19d35dfad1a4245a8dc583681feb3 Mon Sep 17 00:00:00 2001 From: ZhangJan Date: Wed, 30 Aug 2017 17:30:09 +0800 Subject: [PATCH] perf: deep clone slot vnodes on re-render (#6478) avoid unnecessary assignment. --- src/core/vdom/vnode.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/vdom/vnode.js b/src/core/vdom/vnode.js index 751e1414bf..b58664cdc7 100644 --- a/src/core/vdom/vnode.js +++ b/src/core/vdom/vnode.js @@ -95,8 +95,8 @@ export function cloneVNode (vnode: VNode, deep?: boolean): VNode { cloned.key = vnode.key cloned.isComment = vnode.isComment cloned.isCloned = true - if (deep) { - cloned.children = vnode.children && cloneVNodes(vnode.children) + if (deep && vnode.children) { + cloned.children = cloneVNodes(vnode.children) } return cloned }