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

SSR support? #357

Open
yooouuri opened this issue Jun 16, 2023 · 0 comments
Open

SSR support? #357

yooouuri opened this issue Jun 16, 2023 · 0 comments

Comments

@yooouuri
Copy link

Request / Idea

Inject the needed scripts (in the head and body tag) in SSR, so the server wil render the tags.

Additional Context

Use https://github.com/vueuse/head to inject script to the head tag.

Of course this needs some work in the frontend, because you have to get the injected head and merge with your index.html, see: https://github.com/vueuse/head#ssr-rendering

There seems no plugin available to inject stuff into the body, as Evan You states: You should not teleport an element to the body because SSR don't know how to hydrate it. Maybe exposing a function, returning the code to add to the body, and implement it in the SSR implementation live mentioned in the vueuse link.

Im going to need this, so expect a PR soon!

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

No branches or pull requests

1 participant