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

fix #1704
This commit is contained in:
Evan You 2020-07-28 14:15:20 -04:00
parent 578f25c34e
commit 355c052622

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