Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use multiple plugins with parameters in VueJS

Tags:

plugins

vue.js

Let say I have 2 plugins I want to use:

Bootstrap-Vue & Vue Analytics

I would import like so

import BootstrapVue from 'bootstrap-vue'
import VueAnalytics from 'vue-analytics'

How would I use them if one has parameters?

Is this correct?

Vue.use(BootstrapVue, VueAnalytics, {
    id: 'UA-12345678-9'
});
like image 763
Jonathan Avatar asked Dec 06 '22 09:12

Jonathan


1 Answers

Don't overthink it. Just call Vue.use twice.

Vue.use(BootstrapVue);

Vue.use(VueAnalytics, {
    id: 'UA-12345678-9'
});
like image 50
ceejayoz Avatar answered Dec 07 '22 23:12

ceejayoz