Skip to content

Commit

Permalink
fix(runtime-core): dev root resolution should differentiate user comm…
Browse files Browse the repository at this point in the history
…ents vs v-if comments

fix #1704
  • Loading branch information
yyx990803 committed Jul 28, 2020
1 parent 578f25c commit 355c052
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/runtime-core/src/componentRenderUtils.ts
Expand Up @@ -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]
Expand Down

0 comments on commit 355c052

Please sign in to comment.