File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ module.exports = function normalizeComponent (
3939 var hook
4040 if ( isServer ) {
4141 hook = function ( context ) {
42+ // context is injected if this is a cached call
4243 if ( ! context && typeof __VUE_SSR_CONTEXT__ !== 'undefined' ) {
4344 context = __VUE_SSR_CONTEXT__
4445 }
@@ -51,9 +52,14 @@ module.exports = function normalizeComponent (
5152 // never gets called
5253 options . _ssrRegister = hook
5354 } else if ( injectStyles ) {
54- var cssModules = injectStyles ( { } )
55- if ( cssModules ) {
56- hook = function ( ) {
55+ var injected = false // only need to inject once on the client
56+ var cssModules
57+ hook = function ( ) {
58+ if ( ! injected ) {
59+ injected = true
60+ cssModules = injectStyles ( { } )
61+ }
62+ if ( cssModules ) {
5763 for ( var key in cssModules ) {
5864 this [ key ] = cssModules [ key ]
5965 }
You can’t perform that action at this time.
0 commit comments