Skip to content

Commit 094fd9d

Browse files
committed
fix: prevent vue-meta plugin to be installed twice
1 parent ca64ad2 commit 094fd9d

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/browser.js

+6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ import { hasMetaInfo } from './shared/meta-helpers'
1010
* @param {Function} Vue - the Vue constructor.
1111
*/
1212
function install(Vue, options = {}) {
13+
if (Vue.__vuemeta_installed) {
14+
return
15+
}
16+
17+
Vue.__vuemeta_installed = true
18+
1319
options = setOptions(options)
1420

1521
Vue.prototype.$meta = $meta(options)

src/index.js

+6
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ import { hasMetaInfo } from './shared/meta-helpers'
99
* @param {Function} Vue - the Vue constructor.
1010
*/
1111
function install(Vue, options = {}) {
12+
if (Vue.__vuemeta_installed) {
13+
return
14+
}
15+
16+
Vue.__vuemeta_installed = true
17+
1218
options = setOptions(options)
1319

1420
Vue.prototype.$meta = $meta(options)

0 commit comments

Comments
 (0)