ยทยทยท
Plugins
This is a very early preview for the plugin API and this may change in future versions. You might want to wait for a few official plugins as reference before writing your own.
Using a Plugin
Verbose version
1 | // assuming using a CommonJS build system |
Shorthand equivalent
1 | // will auto require('vue-touch') |
The shorthand only works in Component, not in Browserify! Browserify uses static parsing to extract dependencies and cannot handle dynamic require()
.
Optional arguments
1 | // every additional argument will be passed to the plugin |
Plugin Implementation
Note that the passed in Vue
constructor could be an extended Component constructor. Assume that only Vue.require()
and asset registration methods are available. Do not use Vue.config()
inside plugins.
1 | exports.install = function (Vue, options) { |
Caught a mistake or want to contribute to the documentation? Fork this site on Github!