mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-11 20:52:25 +03:00
Update titleTemplate
This commit is contained in:
@@ -342,7 +342,7 @@ Maps to the inner-text value of the `<title>` element.
|
||||
<title>Foo Bar</title>
|
||||
```
|
||||
|
||||
#### `titleTemplate` (String)
|
||||
#### `titleTemplate` (String | Function)
|
||||
|
||||
The value of `title` will be injected into the `%s` placeholder in `titleTemplate` before being rendered. The original title will be available on `metaInfo.titleChunk`.
|
||||
|
||||
@@ -359,6 +359,15 @@ The value of `title` will be injected into the `%s` placeholder in `titleTemplat
|
||||
<title>Foo Bar - Baz</title>
|
||||
```
|
||||
|
||||
The property can also be a function (from [v1.2.0](https://github.com/declandewet/vue-meta/releases/tag/v1.2.0)):
|
||||
|
||||
```js
|
||||
titleTemplate: (titleChunk) => {
|
||||
// If undefined or blank then we don't need the hyphen
|
||||
return titleChunk ? `${titleChunk} - Site Title` : 'Site Title';
|
||||
}
|
||||
```
|
||||
|
||||
#### `htmlAttrs` (Object)
|
||||
|
||||
Each **key:value** maps to the equivalent **attribute:value** of the `<html>` element.
|
||||
|
||||
Reference in New Issue
Block a user