Skip to content

Commit 052c53a

Browse files
committed
Add Implementation to fix issue vuejs#6918
1 parent 9737d1b commit 052c53a

File tree

1 file changed

+6
-0
lines changed
  • src/platforms/web/compiler/modules

1 file changed

+6
-0
lines changed

src/platforms/web/compiler/modules/model.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ function preTransformNode (el: ASTElement, options: CompilerOptions) {
2929
const typeBinding: any = getBindingAttr(el, 'type')
3030
const ifCondition = getAndRemoveAttr(el, 'v-if', true)
3131
const ifConditionExtra = ifCondition ? `&&(${ifCondition})` : ``
32+
const hasElse = getAndRemoveAttr(el, 'v-else', true) != null
3233
// 1. checkbox
3334
const branch0 = cloneASTElement(el)
3435
// process for on the main node
@@ -59,6 +60,11 @@ function preTransformNode (el: ASTElement, options: CompilerOptions) {
5960
exp: ifCondition,
6061
block: branch2
6162
})
63+
64+
if (hasElse) {
65+
branch0.else = true
66+
}
67+
6268
return branch0
6369
}
6470
}

0 commit comments

Comments
 (0)