Skip to content

Commit

Permalink
Add support for installation use Vue.use
Browse files Browse the repository at this point in the history
  • Loading branch information
savoygu committed Dec 31, 2017
1 parent c1261f0 commit 4fd1d42
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ npm install vue-multiple-progress -S
```bash
import Vue from 'vue'
import Progress from 'vue-multiple-progress'
Vue.use('VmProgress', Progress)
# Vue.component('vm-progress', Progress) # 可以指定组件名称
Vue.use(Progress) # 组件名称 `vm-progress`
```

For more information, please refer to [Progress](https://vue-multiple.github.io/progress) in our documentation.
Expand Down
3 changes: 2 additions & 1 deletion example/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import Vue from 'vue'
import App from './App.vue'

import Progress from '../../src/index.js'
Vue.component(Progress.name, Progress)
// Vue.component('vm-progress', Progress)
Vue.use(Progress)

import VueDemonstration from 'vue-demonstration'
Vue.component('demonstration', VueDemonstration)
Expand Down
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ if (typeof window !== 'undefined' && window.Vue) {
Vue.component('VmProgress', Progress)
}

Progress.install = install

export default Progress

0 comments on commit 4fd1d42

Please sign in to comment.