Skip to content

Commit 443675f

Browse files
committed
fix: only set plugin install to false if it exists
1 parent ff92cb3 commit 443675f

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
"vue-loader": "^13.0.5",
8888
"vue-router": "^2.7.0",
8989
"vue-template-compiler": "^2.5.2",
90+
"vuetify": "^0.16.9",
9091
"vuex": "^2.4.1",
9192
"webpack": "^3.6.0",
9293
"webpack-node-externals": "^1.6.0"

src/create-local-vue.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,12 @@ function createLocalVue (): Component {
3131
// compat for vue-router < 2.7.1 where it does not allow multiple installs
3232
const use = instance.use
3333
instance.use = (plugin, ...rest) => {
34-
plugin.installed = false
35-
plugin.install.installed = false
34+
if (plugin.installed === true) {
35+
plugin.installed = false
36+
}
37+
if (plugin.install && plugin.install.installed === true) {
38+
plugin.install.installed = false
39+
}
3640
use.call(instance, plugin, ...rest)
3741
}
3842
return instance

test/unit/specs/create-local-vue.spec.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import createLocalVue from '~src/create-local-vue'
22
import Vuex from 'vuex'
3+
import Vuetify from 'vuetify'
34
import VueRouter from 'vue-router'
45
import mount from '~src/mount'
56
import Component from '~resources/components/component.vue'
@@ -106,4 +107,9 @@ describe('createLocalVue', () => {
106107
}
107108
localVue.use(plugin, pluginOptions)
108109
})
110+
111+
it('installs Vutify successfuly', () => {
112+
const localVue = createLocalVue()
113+
localVue.use(Vuetify)
114+
})
109115
})

0 commit comments

Comments
 (0)