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

Add meta templates

This commit is contained in:
Alexander Lichter
2018-03-19 12:07:07 +01:00
parent 617500fe98
commit 0457b585e5
6 changed files with 246 additions and 9 deletions
+24
View File
@@ -458,6 +458,30 @@ Each item in the array maps to a newly-created `<meta>` element, where object pr
<meta name="viewport" content="width=device-width, initial-scale=1">
```
Since v1.5.0, you can now set up meta templates that work similar to the titleTemplate:
```js
{
metaInfo: {
meta: [
{ charset: 'utf-8' },
{
'vmid': 'og:title',
'property': 'og:title',
'content': 'Test title',
'template': chunk => `${chunk} - My page` //or as string template: '%s - My page'
}
]
}
}
```
```html
<meta charset="utf-8">
<meta name="og:title" property="og:title" content="Test title - My page">
```
#### `link` ([Object])
Each item in the array maps to a newly-created `<link>` element, where object properties map to attributes.