What is Vue.use()

October 19, 2019

You can use Vue.use() global method to install (or call the plug-in) which you develop in your application. (or you can use to call the NPM install plugin)

For example, if you have a plugin developed in your existing application called DataLoader, you can use following code to load that to your Vue instance


So , Your DataLoader will be loaded for your application


Arguments of the use() can be object or function
If the plugin is an Object, it must expose an install method.
This method has to be called before calling new Vue()

You can see the sample code here

// calls `MyPlugin.install(Vue)`

new Vue({
  //... options

If you need more details about how to develop plugin in Vue.js , please look at the following post