File tree Expand file tree Collapse file tree 2 files changed +9
-12
lines changed
src/platforms/web/compiler/directives
test/unit/features/component Expand file tree Collapse file tree 2 files changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -13,19 +13,16 @@ export default function model (
13
13
warn = _warn
14
14
const value = dir . value
15
15
const modifiers = dir . modifiers
16
- if ( el . tag === 'select' ) {
16
+ const tag = el . tag
17
+ const type = el . attrsMap . type
18
+ if ( tag === 'select' ) {
17
19
return genSelect ( el , value )
20
+ } else if ( tag === 'input' && type === 'checkbox' ) {
21
+ genCheckboxModel ( el , value )
22
+ } else if ( tag === 'input' && type === 'radio' ) {
23
+ genRadioModel ( el , value )
18
24
} else {
19
- switch ( el . attrsMap . type ) {
20
- case 'checkbox' :
21
- genCheckboxModel ( el , value )
22
- break
23
- case 'radio' :
24
- genRadioModel ( el , value )
25
- break
26
- default :
27
- return genDefaultModel ( el , value , modifiers )
28
- }
25
+ return genDefaultModel ( el , value , modifiers )
29
26
}
30
27
}
31
28
Original file line number Diff line number Diff line change @@ -483,7 +483,7 @@ describe('Component slot', () => {
483
483
} )
484
484
485
485
// #3518
486
- fit ( 'events should not break when slot is toggled by v-if' , done => {
486
+ it ( 'events should not break when slot is toggled by v-if' , done => {
487
487
const spy = jasmine . createSpy ( )
488
488
const vm = new Vue ( {
489
489
template : `<test><div class="click" @click="test">hi</div></test>` ,
You can’t perform that action at this time.
0 commit comments