Skip to content

Commit 823634b

Browse files
committed
Merge pull request #11 from bpierre/plugin-arguments
Plugin arguments
2 parents 771cd11 + f0e5010 commit 823634b

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

source/api/global-methods.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,9 @@ Vue.js batches view updates and execute them all asynchronously. It uses `reques
149149

150150
Get access to Vue.js' internal modules. This is intended for plugin authors only.
151151

152-
### Vue.use( plguin )
152+
### Vue.use( plugin, [args...] )
153153

154154
- **plugin** `Object` or `Function`
155+
- **args...** *optional*
155156

156157
Mount a Vue.js plugin. If the plugin is an Object, it must have an `install` method. If it is a function itself, it will be treated as the install method. The install method will be called with Vue as the argument. For more details, see [Plugins](/guide/plugin.html).

source/guide/plugin.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,17 @@ Vue.use(vueTouch)
2222
Vue.use('vue-touch')
2323
```
2424

25+
### Optional arguments
26+
27+
```js
28+
// every additional argument will be passed to the plugin
29+
Vue.use('vue-touch', { moveTolerance: 12 })
30+
```
31+
2532
## Plugin Implementation
2633

2734
``` js
28-
exports.install = function (Vue) {
35+
exports.install = function (Vue, options) {
2936
// use Vue.require to access internal modules
3037
var utils = Vue.require('utils')
3138
}

0 commit comments

Comments
 (0)