mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-23 11:50:34 +03:00
support title template
This commit is contained in:
@@ -32,6 +32,7 @@
|
|||||||
// define API methods on the `$vueMeta` instance property
|
// define API methods on the `$vueMeta` instance property
|
||||||
Object.defineProperty(Vue.prototype, '$vueMeta', {
|
Object.defineProperty(Vue.prototype, '$vueMeta', {
|
||||||
enumerable: true,
|
enumerable: true,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Meta info manager API factory
|
* Meta info manager API factory
|
||||||
* @return {Object} - the API for this plugin
|
* @return {Object} - the API for this plugin
|
||||||
@@ -59,7 +60,11 @@
|
|||||||
* @return {Object} - all the meta info for currently matched components
|
* @return {Object} - all the meta info for currently matched components
|
||||||
*/
|
*/
|
||||||
function getMetaInfo () {
|
function getMetaInfo () {
|
||||||
return getMetaInfoDefinition(Vue, this)
|
var info = getMetaInfoDefinition(Vue, this)
|
||||||
|
if (info.titleTemplate) {
|
||||||
|
info.title = info.titleTemplate.replace('%s', info.title)
|
||||||
|
}
|
||||||
|
return info
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,6 +116,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// meta info is ready for consumption
|
||||||
return metaInfo
|
return metaInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user