File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
src/platforms/web/server/modules Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,8 @@ export function genStyle (style: Object): string {
2323function normalizeValue ( key : string , value : any ) : string {
2424 if (
2525 typeof value === 'string' ||
26- ( typeof value === 'number' && noUnitNumericStyleProps [ key ] )
26+ ( typeof value === 'number' && noUnitNumericStyleProps [ key ] ) ||
27+ value === 0
2728 ) {
2829 return `${ key } :${ value } ;`
2930 } else {
Original file line number Diff line number Diff line change @@ -1529,13 +1529,14 @@ describe('SSR: renderToString', () => {
15291529 data : {
15301530 style : {
15311531 opacity : 0 , // valid, opacity is unit-less
1532- top : 0 , // invalid, top requires unit
1532+ top : 0 , // valid, top requires unit but 0 is allowed
1533+ left : 10 , // invalid, left requires a unit
15331534 marginTop : '10px' // valid
15341535 }
15351536 }
15361537 } , result => {
15371538 expect ( result ) . toContain (
1538- '<div data-server-rendered="true" style="opacity:0;margin-top:10px;"></div>'
1539+ '<div data-server-rendered="true" style="opacity:0;top:0; margin-top:10px;"></div>'
15391540 )
15401541 done ( )
15411542 } )
You can’t perform that action at this time.
0 commit comments