18. Plugins

Plugins

Writing a Plugin

Plugins usually add global-level functionality to Vue. There is no strictly defined scope for a plugin - there are typically several types of plugins you can write:

  1. Add some global methods or properties. e.g. vue-custom-element

  2. Add one or more global assets: directives/filters/transitions etc. e.g. vue-touch

  3. Add some component options by global mixin. e.g. vuex

  4. Add some Vue instance methods by attaching them to Vue.prototype.

  5. A library that provides an A