fix(compiler/v-if): avoid incorrect transform application on v-else/else-if branch children

This commit is contained in:
Evan You 2019-10-07 12:48:43 -04:00
parent caaeaff2fd
commit 3146e6b942

View File

@ -105,6 +105,9 @@ export const transformIf = createStructuralDirectiveTransform(
// since the branch was removed, it will not be traversed.
// make sure to traverse here.
traverseChildren(branch, context)
// make sure to reset currentNode after traversal to indicate this
// node has been removed.
context.currentNode = null
// attach this branch's codegen node to the v-if root.
let parentCondition = sibling.codegenNode
.expressions[1] as ConditionalExpression