Some plugins provided by Vue.js official plugins such as vue-router automatically calls Vue.use() if Vue is available as a global variable. Vue.use automatically prevents you from using the same plugin more than once, so calling it multiple times on the same plugin will install the plugin only once. You can optionally pass in some options: Vue.use(MyPlugin, ) This has to be done before you start your app by calling new Vue(): // calls `MyPlugin.install(Vue)` Use plugins by calling the Vue.use() global method. vue-routerĪdd some Vue instance methods by attaching them to Vue.prototype.Ī library that provides an API of its own, while at the same time injecting some combination of the above. vue-touchĪdd some component options by global mixin. vue-custom-elementĪdd one or more global assets: directives/filters/transitions etc. There is no strictly defined scope for a plugin - there are typically several types of plugins:Īdd some global methods or properties. Plugins usually add global-level functionality to Vue.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |