mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-23 02:10:33 +03:00
Rerun Coverage CI
This commit is contained in:
@@ -81,6 +81,7 @@
|
|||||||
|
|
||||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||||
|
|
||||||
|
|
||||||
# Description
|
# Description
|
||||||
`vue-meta` is a [Vue 2.0](https://vuejs.org) plugin that allows you to manage your app's meta information, much like [`react-helmet`](https://github.com/nfl/react-helmet) does for React. However, instead of setting your data as props passed to a proprietary component, you simply export it as part of your component's data using the `metaInfo` property.
|
`vue-meta` is a [Vue 2.0](https://vuejs.org) plugin that allows you to manage your app's meta information, much like [`react-helmet`](https://github.com/nfl/react-helmet) does for React. However, instead of setting your data as props passed to a proprietary component, you simply export it as part of your component's data using the `metaInfo` property.
|
||||||
|
|
||||||
@@ -192,7 +193,7 @@ app.get('*', (req, res) => {
|
|||||||
const context = { url: req.url }
|
const context = { url: req.url }
|
||||||
renderer.renderToString(context, (error, html) => {
|
renderer.renderToString(context, (error, html) => {
|
||||||
if (error) return res.send(error.stack)
|
if (error) return res.send(error.stack)
|
||||||
const {
|
const {
|
||||||
title, htmlAttrs, bodyAttrs, link, style, script, noscript, meta
|
title, htmlAttrs, bodyAttrs, link, style, script, noscript, meta
|
||||||
} = context.meta.inject()
|
} = context.meta.inject()
|
||||||
return res.send(`
|
return res.send(`
|
||||||
@@ -385,7 +386,7 @@ Each **key:value** maps to the equivalent **attribute:value** of the `<body>` el
|
|||||||
{
|
{
|
||||||
metaInfo: {
|
metaInfo: {
|
||||||
bodyAttrs: {
|
bodyAttrs: {
|
||||||
bar: 'baz'
|
bar: 'baz'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -397,7 +398,7 @@ Each **key:value** maps to the equivalent **attribute:value** of the `<body>` el
|
|||||||
|
|
||||||
#### `base` (Object)
|
#### `base` (Object)
|
||||||
|
|
||||||
Maps to a newly-created `<base>` element, where object properties map to attributes.
|
Maps to a newly-created `<base>` element, where object properties map to attributes.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
@@ -413,7 +414,7 @@ Maps to a newly-created `<base>` element, where object properties map to attribu
|
|||||||
|
|
||||||
#### `meta` ([Object])
|
#### `meta` ([Object])
|
||||||
|
|
||||||
Each item in the array maps to a newly-created `<meta>` element, where object properties map to attributes.
|
Each item in the array maps to a newly-created `<meta>` element, where object properties map to attributes.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
@@ -433,7 +434,7 @@ Each item in the array maps to a newly-created `<meta>` element, where object pr
|
|||||||
|
|
||||||
#### `link` ([Object])
|
#### `link` ([Object])
|
||||||
|
|
||||||
Each item in the array maps to a newly-created `<link>` element, where object properties map to attributes.
|
Each item in the array maps to a newly-created `<link>` element, where object properties map to attributes.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
@@ -453,7 +454,7 @@ Each item in the array maps to a newly-created `<link>` element, where object pr
|
|||||||
|
|
||||||
#### `style` ([Object])
|
#### `style` ([Object])
|
||||||
|
|
||||||
Each item in the array maps to a newly-created `<style>` element, where object properties map to attributes.
|
Each item in the array maps to a newly-created `<style>` element, where object properties map to attributes.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
@@ -471,7 +472,7 @@ Each item in the array maps to a newly-created `<style>` element, where object p
|
|||||||
|
|
||||||
#### `script` ([Object])
|
#### `script` ([Object])
|
||||||
|
|
||||||
Each item in the array maps to a newly-created `<script>` element, where object properties map to attributes.
|
Each item in the array maps to a newly-created `<script>` element, where object properties map to attributes.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
@@ -489,7 +490,7 @@ Each item in the array maps to a newly-created `<script>` element, where object
|
|||||||
|
|
||||||
#### `noscript` ([Object])
|
#### `noscript` ([Object])
|
||||||
|
|
||||||
Each item in the array maps to a newly-created `<noscript>` element, where object properties map to attributes.
|
Each item in the array maps to a newly-created `<noscript>` element, where object properties map to attributes.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
@@ -664,7 +665,7 @@ Easy. Instead of defining `metaInfo` as an object, define it as a function and a
|
|||||||
description: 'A blog post about some stuff'
|
description: 'A blog post about some stuff'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
metaInfo ()
|
metaInfo ()
|
||||||
return {
|
return {
|
||||||
title: this.title,
|
title: this.title,
|
||||||
meta: [
|
meta: [
|
||||||
@@ -686,7 +687,7 @@ Easy. Instead of defining `metaInfo` as an object, define it as a function and a
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Post from './Post.vue'
|
import Post from './Post.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'post-container',
|
name: 'post-container',
|
||||||
components: { Post },
|
components: { Post },
|
||||||
|
|||||||
Reference in New Issue
Block a user