2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-11 19:42:24 +03:00

fix: prevent vue-meta plugin to be installed twice

This commit is contained in:
pimlie
2019-06-09 20:16:38 +02:00
parent ca64ad2f34
commit 094fd9d14c
2 changed files with 12 additions and 0 deletions
+6
View File
@@ -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)
+6
View File
@@ -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)