File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
test/unit/specs/directives Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ function checkInitialValue () {
134134 }
135135 }
136136 }
137- if ( initValue ) {
137+ if ( typeof initValue !== 'undefined' ) {
138138 this . _initValue = this . number
139139 ? _ . toNumber ( initValue )
140140 : initValue
Original file line number Diff line number Diff line change @@ -156,6 +156,16 @@ if (_.inBrowser) {
156156 expect ( el . firstChild . childNodes [ 1 ] . selected ) . toBe ( true )
157157 } )
158158
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+
159169 it ( 'select + multiple' , function ( done ) {
160170 var vm = new Vue ( {
161171 el : el ,
You can’t perform that action at this time.
0 commit comments