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) {
94
94
if ( options . paramAttributes ) {
95
95
options . paramAttributes . forEach ( function ( attr ) {
96
96
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 )
98
100
} )
99
101
}
100
102
Original file line number Diff line number Diff line change @@ -608,13 +608,15 @@ describe('UNIT: API', function () {
608
608
var Test = Vue . extend ( {
609
609
template : '<div a="1" b="hello"></div>' ,
610
610
replace : true ,
611
- paramAttributes : [ 'a' , 'b' ]
611
+ paramAttributes : [ 'a' , 'b' , 'c' ]
612
612
} )
613
613
var v = new Test ( )
614
614
assert . strictEqual ( v . a , 1 )
615
615
assert . strictEqual ( v . $data . a , 1 )
616
616
assert . strictEqual ( v . b , 'hello' )
617
617
assert . strictEqual ( v . $data . b , 'hello' )
618
+ assert . strictEqual ( v . c , null )
619
+ assert . strictEqual ( v . $data . c , null )
618
620
} )
619
621
620
622
} )
You can’t perform that action at this time.
0 commit comments