diff --git a/src/create-local-vue.js b/src/create-local-vue.js index 61afd5ef8..b17863358 100644 --- a/src/create-local-vue.js +++ b/src/create-local-vue.js @@ -30,10 +30,10 @@ function createLocalVue (): Component { // compat for vue-router < 2.7.1 where it does not allow multiple installs const use = instance.use - instance.use = (plugin) => { + instance.use = (plugin, ...rest) => { plugin.installed = false plugin.install.installed = false - use.call(instance, plugin) + use.call(instance, plugin, ...rest) } return instance } diff --git a/test/unit/specs/create-local-vue.spec.js b/test/unit/specs/create-local-vue.spec.js index cc5e77c72..3443fed30 100644 --- a/test/unit/specs/create-local-vue.spec.js +++ b/test/unit/specs/create-local-vue.spec.js @@ -95,4 +95,15 @@ describe('createLocalVue', () => { const freshWrapper = mount(Component) expect(typeof freshWrapper.vm.$route).to.equal('undefined') }) + + it('use can take additional arguments', () => { + const localVue = createLocalVue() + const pluginOptions = { foo: 'bar' } + const plugin = { + install: function (_Vue, options) { + expect(options).to.equal(pluginOptions) + } + } + localVue.use(plugin, pluginOptions) + }) })