@@ -28,14 +28,15 @@ function preTransformNode (el: ASTElement, options: CompilerOptions) {
28
28
if ( map [ 'v-model' ] && ( map [ 'v-bind:type' ] || map [ ':type' ] ) ) {
29
29
const typeBinding : any = getBindingAttr ( el , 'type' )
30
30
const ifCondition = getAndRemoveAttr ( el , 'v-if' , true )
31
+ const ifConditionExtra = ifCondition ? `&&(${ ifCondition } )` : ``
31
32
// 1. checkbox
32
33
const branch0 = cloneASTElement ( el )
33
34
// process for on the main node
34
35
processFor ( branch0 )
35
36
addRawAttr ( branch0 , 'type' , 'checkbox' )
36
37
processElement ( branch0 , options )
37
38
branch0 . processed = true // prevent it from double-processed
38
- branch0 . if = `type==='checkbox'` + ( ifCondition ? `&&( ${ ifCondition } )` : `` )
39
+ branch0 . if = `type==='checkbox'` + ifConditionExtra
39
40
addIfCondition ( branch0 , {
40
41
exp : branch0 . if ,
41
42
block : branch0
@@ -46,7 +47,7 @@ function preTransformNode (el: ASTElement, options: CompilerOptions) {
46
47
addRawAttr ( branch1 , 'type' , 'radio' )
47
48
processElement ( branch1 , options )
48
49
addIfCondition ( branch0 , {
49
- exp : `type==='radio'` + ( ifCondition ? `&&( ${ ifCondition } )` : `` ) ,
50
+ exp : `type==='radio'` + ifConditionExtra ,
50
51
block : branch1
51
52
} )
52
53
// 3. other
0 commit comments