From: Evan You Date: Mon, 7 Oct 2019 16:48:43 +0000 (-0400) Subject: fix(compiler/v-if): avoid incorrect transform application on v-else/else-if branch... X-Git-Tag: v3.0.0-alpha.0~567 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3146e6b942aa7b024184dfc466b4d85200c5bc32;p=thirdparty%2Fvuejs%2Fcore.git fix(compiler/v-if): avoid incorrect transform application on v-else/else-if branch children --- diff --git a/packages/compiler-core/src/transforms/vIf.ts b/packages/compiler-core/src/transforms/vIf.ts index b1182aa83a..76df830dc5 100644 --- a/packages/compiler-core/src/transforms/vIf.ts +++ b/packages/compiler-core/src/transforms/vIf.ts @@ -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