|
@@ -29,6 +29,8 @@ function preTransformNode (el: ASTElement, options: CompilerOptions) {
|
|
|
const typeBinding: any = getBindingAttr(el, 'type')
|
|
const typeBinding: any = getBindingAttr(el, 'type')
|
|
|
const ifCondition = getAndRemoveAttr(el, 'v-if', true)
|
|
const ifCondition = getAndRemoveAttr(el, 'v-if', true)
|
|
|
const ifConditionExtra = ifCondition ? `&&(${ifCondition})` : ``
|
|
const ifConditionExtra = ifCondition ? `&&(${ifCondition})` : ``
|
|
|
|
|
+ const hasElse = getAndRemoveAttr(el, 'v-else', true) != null
|
|
|
|
|
+ const elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true)
|
|
|
// 1. checkbox
|
|
// 1. checkbox
|
|
|
const branch0 = cloneASTElement(el)
|
|
const branch0 = cloneASTElement(el)
|
|
|
// process for on the main node
|
|
// process for on the main node
|
|
@@ -59,6 +61,13 @@ function preTransformNode (el: ASTElement, options: CompilerOptions) {
|
|
|
exp: ifCondition,
|
|
exp: ifCondition,
|
|
|
block: branch2
|
|
block: branch2
|
|
|
})
|
|
})
|
|
|
|
|
+
|
|
|
|
|
+ if (hasElse) {
|
|
|
|
|
+ branch0.else = true
|
|
|
|
|
+ } else if (elseIfCondition) {
|
|
|
|
|
+ branch0.elseif = elseIfCondition
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
return branch0
|
|
return branch0
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|