]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(runtime-core): dev root resolution should differentiate user comments vs v-if...
authorEvan You <yyx990803@gmail.com>
Tue, 28 Jul 2020 18:15:20 +0000 (14:15 -0400)
committerEvan You <yyx990803@gmail.com>
Tue, 28 Jul 2020 18:16:09 +0000 (14:16 -0400)
fix #1704

packages/runtime-core/src/componentRenderUtils.ts

index 5f3910f7cc059941c0afe9e53203d49f18c0e90f..2c05358d5615d1b16af1de0681b4aeff714f6eca 100644 (file)
@@ -235,7 +235,11 @@ const getChildRoot = (
   const rawChildren = vnode.children as VNodeArrayChildren
   const dynamicChildren = vnode.dynamicChildren as VNodeArrayChildren
   const children = rawChildren.filter(child => {
-    return !(isVNode(child) && child.type === Comment)
+    return !(
+      isVNode(child) &&
+      child.type === Comment &&
+      child.children !== 'v-if'
+    )
   })
   if (children.length !== 1) {
     return [vnode, undefined]