Multiple components in Vue.use

1

I'm using these components in my code

Vue.use(Toaster, {timeout: 5000})
Vue.use(VueAlert)
Vue.use(VueSweetAlert)

Is there any way I can bind these three in just Vue.use ?

Something like this ( incorrect )

Vue.use([
         { Toaster, {timeout: 5000} },
         { VueAlert },
         { VueSweetAlert }
        ])

Thank you!

    
asked by anonymous 20.10.2017 / 15:49

1 answer

2

Notice the native method

/* @flow */

import { toArray } from '../util/index'

export function initUse (Vue: GlobalAPI) {
  Vue.use = function (plugin: Function | Object) {
const installedPlugins = (this._installedPlugins || (this._installedPlugins = []))

Vue.use only receives an object or a function, it is not possible to pass multiple objects: /

    
20.10.2017 / 16:02