Skip to content

Commit

Permalink
Add Implementation to fix issue vuejs#6918
Browse files Browse the repository at this point in the history
  • Loading branch information
misoguy committed Oct 30, 2017
1 parent 9737d1b commit 052c53a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/platforms/web/compiler/modules/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -59,6 +60,11 @@ function preTransformNode (el: ASTElement, options: CompilerOptions) {
exp: ifCondition,
block: branch2
})

if (hasElse) {
branch0.else = true
}

return branch0
}
}
Expand Down

0 comments on commit 052c53a

Please sign in to comment.