This repository was archived by the owner on Nov 9, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -7,9 +7,10 @@ function renderToString(vnode) {
7
7
var attrs = ""
8
8
for ( var i in attrNames ) {
9
9
var currentAttrName = attrNames [ i ]
10
- var content = currentAttrName == "style"
11
- ? stringifyStyle ( vnode . data [ currentAttrName ] )
12
- : vnode . data [ currentAttrName ]
10
+ var content =
11
+ currentAttrName == "style"
12
+ ? stringifyStyle ( vnode . data [ currentAttrName ] )
13
+ : vnode . data [ currentAttrName ]
13
14
14
15
attrs += " " + currentAttrName + '="' + content + '"'
15
16
}
@@ -32,7 +33,10 @@ function stringifyStyle(style) {
32
33
for ( var i in properties ) {
33
34
var curProp = properties [ i ]
34
35
inlineStyle +=
35
- curProp . replace ( / [ A - Z ] / , "-$&" ) . toLowerCase ( ) + ":" + style [ curProp ] + ";"
36
+ curProp . replace ( / [ A - Z ] / g, "-$&" ) . toLowerCase ( ) +
37
+ ":" +
38
+ style [ curProp ] +
39
+ ";"
36
40
}
37
41
38
42
return inlineStyle
Original file line number Diff line number Diff line change @@ -44,6 +44,10 @@ test("style", () => {
44
44
{
45
45
vnode : createVNode ( { data : { style : { backgroundColor : "papayawhip" } } } ) ,
46
46
html : `<div style="background-color:papayawhip;"></div>`
47
+ } ,
48
+ {
49
+ vnode : createVNode ( { data : { style : { backgroundColor : "papayawhip" , borderTopLeftRadius : "10px" } } } ) ,
50
+ html : `<div style="background-color:papayawhip;border-top-left-radius:10px;"></div>`
47
51
}
48
52
] )
49
53
} )
You can’t perform that action at this time.
0 commit comments