Skip to content

Commit 69d6595

Browse files
committed
fix ssr style registration
1 parent f03f68c commit 69d6595

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

lib/addStylesServer.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,16 @@ module.exports = function (parentId, list, isProduction, context) {
55
context = __VUE_SSR_CONTEXT__
66
}
77
if (context) {
8-
var styles = context._styles
9-
10-
if (!styles) {
11-
styles = context._styles = {}
8+
if (!context.hasOwnProperty('styles')) {
129
Object.defineProperty(context, 'styles', {
1310
enumberable: true,
14-
get : function() {
15-
return (
16-
context._renderedStyles ||
17-
(context._renderedStyles = renderStyles(styles))
18-
)
11+
get: function() {
12+
return renderStyles(context._styles)
1913
}
2014
})
2115
}
2216

17+
var styles = context._styles || (context._styles = {})
2318
list = listToStyles(parentId, list)
2419
if (isProduction) {
2520
addStyleProd(styles, list)

0 commit comments

Comments
 (0)