File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -94,7 +94,9 @@ function Compiler (vm, options) {
9494 if ( options . paramAttributes ) {
9595 options . paramAttributes . forEach ( function ( attr ) {
9696 var val = el . getAttribute ( attr )
97- vm [ attr ] = isNaN ( val ) ? val : Number ( val )
97+ vm [ attr ] = ( isNaN ( val ) || val === null )
98+ ? val
99+ : Number ( val )
98100 } )
99101 }
100102
Original file line number Diff line number Diff line change @@ -608,13 +608,15 @@ describe('UNIT: API', function () {
608608 var Test = Vue . extend ( {
609609 template : '<div a="1" b="hello"></div>' ,
610610 replace : true ,
611- paramAttributes : [ 'a' , 'b' ]
611+ paramAttributes : [ 'a' , 'b' , 'c' ]
612612 } )
613613 var v = new Test ( )
614614 assert . strictEqual ( v . a , 1 )
615615 assert . strictEqual ( v . $data . a , 1 )
616616 assert . strictEqual ( v . b , 'hello' )
617617 assert . strictEqual ( v . $data . b , 'hello' )
618+ assert . strictEqual ( v . c , null )
619+ assert . strictEqual ( v . $data . c , null )
618620 } )
619621
620622 } )
You can’t perform that action at this time.
0 commit comments