File tree 2 files changed +11
-1
lines changed
test/unit/specs/directives
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ function checkInitialValue () {
134
134
}
135
135
}
136
136
}
137
- if ( initValue ) {
137
+ if ( typeof initValue !== 'undefined' ) {
138
138
this . _initValue = this . number
139
139
? _ . toNumber ( initValue )
140
140
: initValue
Original file line number Diff line number Diff line change @@ -156,6 +156,16 @@ if (_.inBrowser) {
156
156
expect ( el . firstChild . childNodes [ 1 ] . selected ) . toBe ( true )
157
157
} )
158
158
159
+ it ( 'select + empty default value' , function ( ) {
160
+ var vm = new Vue ( {
161
+ el : el ,
162
+ template : '<select v-model="test"><option value="" selected>null</option><<option value="1">1</option></select>'
163
+ } )
164
+ expect ( vm . test ) . toBe ( '' )
165
+ trigger ( vm . $el . firstChild , 'change' )
166
+ expect ( vm . test ) . toBe ( '' )
167
+ } )
168
+
159
169
it ( 'select + multiple' , function ( done ) {
160
170
var vm = new Vue ( {
161
171
el : el ,
You can’t perform that action at this time.
0 commit comments