mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-24 22:30:34 +03:00
fix: Handle Vue mixin to add meta tags
This commit is contained in:
@@ -41,7 +41,9 @@ export default function VueMeta (Vue, options = {}) {
|
|||||||
Vue.mixin({
|
Vue.mixin({
|
||||||
beforeCreate () {
|
beforeCreate () {
|
||||||
// Add a marker to know if it uses metaInfo
|
// Add a marker to know if it uses metaInfo
|
||||||
if (typeof this.$options[options.keyName] !== 'undefined') {
|
// _vnode is used to know that it's attached to a real component
|
||||||
|
// useful if we use some mixin to add some meta tags (like nuxt-i18n)
|
||||||
|
if (this._vnode && typeof this.$options[options.keyName] !== 'undefined') {
|
||||||
this._hasMetaInfo = true
|
this._hasMetaInfo = true
|
||||||
}
|
}
|
||||||
// coerce function-style metaInfo to a computed prop so we can observe
|
// coerce function-style metaInfo to a computed prop so we can observe
|
||||||
|
|||||||
Reference in New Issue
Block a user