Vue.jsPlugins

Introduction

Vue plugins adds global functionality as, global methods, directives, transitions, filters, instance methods, objects and inject some component options using mixins

Syntax

  • MyPlugin.install = function (Vue, options) {}

Parameters

NameDescription
VueVue constructor, injected by Vue
optionsAdditional options if needed

Remarks

In most cases you will need to explicitly tell Vue to use a plugin

// calls `MyPlugin.install(Vue)`
Vue.use(MyPlugin)

To pass options

Vue.use(MyPlugin, { someOption: true })