From 052c53a28a9b3b7592f0befd8f24f7f9ef5ec325 Mon Sep 17 00:00:00 2001 From: Soo Jae Hwang Date: Mon, 30 Oct 2017 12:17:54 +0900 Subject: [PATCH] Add Implementation to fix issue #6918 --- src/platforms/web/compiler/modules/model.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/platforms/web/compiler/modules/model.js b/src/platforms/web/compiler/modules/model.js index 61657d1fa43..6bad91b8b16 100644 --- a/src/platforms/web/compiler/modules/model.js +++ b/src/platforms/web/compiler/modules/model.js @@ -29,6 +29,7 @@ function preTransformNode (el: ASTElement, options: CompilerOptions) { const typeBinding: any = getBindingAttr(el, 'type') const ifCondition = getAndRemoveAttr(el, 'v-if', true) const ifConditionExtra = ifCondition ? `&&(${ifCondition})` : `` + const hasElse = getAndRemoveAttr(el, 'v-else', true) != null // 1. checkbox const branch0 = cloneASTElement(el) // process for on the main node @@ -59,6 +60,11 @@ function preTransformNode (el: ASTElement, options: CompilerOptions) { exp: ifCondition, block: branch2 }) + + if (hasElse) { + branch0.else = true + } + return branch0 } }