2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-12 10:52:24 +03:00
This commit is contained in:
geekguy
2017-11-08 01:44:53 +05:30
parent 00444d0019
commit 35d4bb112b
+12 -1
View File
@@ -220,6 +220,17 @@ app.get('*', (req, res) => {
})
```
If you are using a separate template file, edit your head tag with
```html
<head>
{{{ meta.inject().title.text() }}}
{{{ meta.inject().meta.text() }}}
</head>
```
Notice the use of `{{{` to avoid double escaping. Be extremely cautious when you use `{{{` with `__dangerouslyDisableSanitizers`.
#### Streaming Rendering with `renderToStream()`
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:
@@ -677,7 +688,7 @@ Easy. Instead of defining `metaInfo` as an object, define it as a function and a
```html
<template>
<div>
<h1>{{ title }}</h1>
<h1>{{{ title }}}</h1>
</div>
</template>