From 8678ae311761f577f908f21f4786320c5217c667 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Chopin?= Date: Thu, 5 Jul 2018 17:58:52 +0200 Subject: [PATCH] fix: Handle Vue mixin to add meta tags --- src/shared/plugin.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/shared/plugin.js b/src/shared/plugin.js index 86f5caa..8fde2c0 100644 --- a/src/shared/plugin.js +++ b/src/shared/plugin.js @@ -41,7 +41,9 @@ export default function VueMeta (Vue, options = {}) { Vue.mixin({ beforeCreate () { // 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 } // coerce function-style metaInfo to a computed prop so we can observe