Browse Source

fix(runtime-core): dev root resolution should differentiate user comments vs v-if comments

fix #1704
Evan You 5 years ago
parent
commit
355c052622
1 changed files with 5 additions and 1 deletions
  1. 5 1
      packages/runtime-core/src/componentRenderUtils.ts

+ 5 - 1
packages/runtime-core/src/componentRenderUtils.ts

@@ -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]