Stats

111 Contributors: 1 Thursday, January 5, 2017
Licensed under: CC-BY-SA
Not affiliated with Stack Overflow
Rip Tutorial: riptutorial@gmail.com
Roadmap: roadmap

Plugins

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 })

Related Examples