]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(compiler/v-if): avoid incorrect transform application on v-else/else-if branch...
authorEvan You <yyx990803@gmail.com>
Mon, 7 Oct 2019 16:48:43 +0000 (12:48 -0400)
committerEvan You <yyx990803@gmail.com>
Mon, 7 Oct 2019 16:48:43 +0000 (12:48 -0400)
packages/compiler-core/src/transforms/vIf.ts

index b1182aa83a9b590d7f80f49bfa7fd507b5a2aff5..76df830dc5a23e8e98cb95ac8ed520f8c44a346e 100644 (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