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

html meta data #1040

Closed
borodadada opened this issue Nov 9, 2020 · 3 comments
Closed

html meta data #1040

borodadada opened this issue Nov 9, 2020 · 3 comments

Comments

@borodadada
Copy link

Hello, i search how i can set meta data from vue 3 ssr project. Anybody know?
I found empty project "vite-plugin-meta": "^0.0.1"

@underfin
Copy link
Member

I'm not sure your code details, here has a example, may it can help you out.

server.get('*', (req, res) => {
  const app = createSSRApp(App);
   const html = await renderer.renderToString(app)
   res.end(`<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <link rel="icon" href="/favicon.ico" />
  ${meta} // add your meta at here
  <title>Vite App</title>
</head>
<body>
  <div id="app" data-server-render>${html}</div>
  <script type="module" src="/src/entry-client.js"></script>
</body>
</html>`)
})

@borodadada
Copy link
Author

yes, but i need set meta from vue template, in vue 2 i use vue-meta, but in vue 3 i don't know... need hook

@underfin
Copy link
Member

Here has a workaround nuxt/vue-meta#558 (comment), it should help you out.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants