Vue.js Plugins

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

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


Got any Vue.js Question?