Skip to content

Commit

Permalink
fix: prevent vue-meta plugin to be installed twice
Browse files Browse the repository at this point in the history
  • Loading branch information
pimlie committed Jun 9, 2019
1 parent ca64ad2 commit 094fd9d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 094fd9d

Please sign in to comment.