From 094fd9d14cfc4a704593984cc4173c6bbe20ecef Mon Sep 17 00:00:00 2001 From: pimlie Date: Sun, 9 Jun 2019 20:16:38 +0200 Subject: [PATCH] fix: prevent vue-meta plugin to be installed twice --- src/browser.js | 6 ++++++ src/index.js | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/browser.js b/src/browser.js index 73693f05..38915227 100644 --- a/src/browser.js +++ b/src/browser.js @@ -10,6 +10,12 @@ import { hasMetaInfo } from './shared/meta-helpers' * @param {Function} Vue - the Vue constructor. */ function install(Vue, options = {}) { + if (Vue.__vuemeta_installed) { + return + } + + Vue.__vuemeta_installed = true + options = setOptions(options) Vue.prototype.$meta = $meta(options) diff --git a/src/index.js b/src/index.js index 303c73d7..6ee009a2 100644 --- a/src/index.js +++ b/src/index.js @@ -9,6 +9,12 @@ import { hasMetaInfo } from './shared/meta-helpers' * @param {Function} Vue - the Vue constructor. */ function install(Vue, options = {}) { + if (Vue.__vuemeta_installed) { + return + } + + Vue.__vuemeta_installed = true + options = setOptions(options) Vue.prototype.$meta = $meta(options)