Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:add ssr styles inject function. #1855

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lifeishell
Copy link

@lifeishell lifeishell commented Jul 19, 2021

feat: Finish SSR part css inject.
linked to #1759

Exposes style's __inject__ function (which comes from vue-style-loader ) to script
Then you can use it to append styles on SSR context
Usage:

App.__inject__(context); // append styles on req context 
app = Vue.createSSRApp(App, context);
... other ssr codes ...
html = template.replace('</head>', `${context.context || ''}</head>`); // append styles to html head

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant