2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-21 11:40:33 +03:00

docs: update docs with new features (#416)

This commit is contained in:
Pim
2019-07-24 16:06:50 +02:00
committed by GitHub
parent 253108afac
commit 8f441899ef
8 changed files with 264 additions and 28 deletions
+13 -2
View File
@@ -37,7 +37,7 @@ app.get('*', (req, res) => {
} = context.meta.inject()
return res.send(`
<!doctype html>
<html data-vue-meta-server-rendered ${htmlAttrs.text()}>
<html ${htmlAttrs.text(true)}>
<head ${headAttrs.text()}>
${meta.text()}
${title.text()}
@@ -47,10 +47,22 @@ app.get('*', (req, res) => {
${noscript.text()}
</head>
<body ${bodyAttrs.text()}>
<!-- prepended metaInfo properties -->
${style.text({ pbody: true })}
${script.text({ pbody: true })}
${noscript.text({ pbody: true })}
<!-- app -->
${html}
<!-- webpack assets -->
<script src="/assets/vendor.bundle.js"></script>
<script src="/assets/client.bundle.js"></script>
<!-- appended metaInfo properties -->
${style.text({ body: true })}
${script.text({ body: true })}
${noscript.text({ body: true })}
</body>
</html>
`)
@@ -71,7 +83,6 @@ Notice the use of `{{{` to avoid double escaping. Be extremely cautious when you
## Inject metadata into page stream
A little more complex, but well worth it, is to instead stream your response. `vue-meta` supports streaming with no effort (on it's part :stuck_out_tongue_winking_eye:) thanks to Vue's clever `bundleRenderer` context injection:
**server.js**