File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
src/server/optimizing-compiler Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ export function genStyleSegments (
106
106
vShowExpression : ?string
107
107
) : Array < StringSegment > {
108
108
if ( staticStyle && ! styleBinding && ! vShowExpression ) {
109
- return [ { type : RAW , value : ` style=${ JSON . stringify ( staticStyle ) } ` } ]
109
+ return [ { type : RAW , value : ` style=${ JSON . stringify ( staticStyle . replace ( / \n / g , '' ) ) } ` } ] ;
110
110
} else {
111
111
return [ {
112
112
type : EXPRESSION ,
Original file line number Diff line number Diff line change @@ -1668,6 +1668,24 @@ describe('SSR: renderToString', () => {
1668
1668
} )
1669
1669
} )
1670
1670
1671
+ it ( 'only static style and not v-show ' , done => {
1672
+ renderVmWithOptions ( {
1673
+ template : ` <div
1674
+ style="
1675
+ margin-top:
1676
+ 0px;width: 24px;
1677
+ height: 16px;
1678
+ vertical-align: text-bottom;
1679
+ fill: #bfbfc3;"
1680
+ ></div>` ,
1681
+ } , result => {
1682
+ expect ( result ) . toContain (
1683
+ '<div data-server-rendered="true" style="width:24px;height:16px;vertical-align:text-bottom;fill:#bfbfc3;"></div>'
1684
+ )
1685
+ done ( )
1686
+ } )
1687
+ } )
1688
+
1671
1689
function renderVmWithOptions ( options , cb ) {
1672
1690
renderToString ( new Vue ( options ) , ( err , res ) => {
1673
1691
expect ( err ) . toBeNull ( )
You can’t perform that action at this time.
0 commit comments