Skip to content

Commit 4fd1d42

Browse files
author
savoygu
committed
Add support for installation use Vue.use
1 parent c1261f0 commit 4fd1d42

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ npm install vue-multiple-progress -S
1313
```bash
1414
import Vue from 'vue'
1515
import Progress from 'vue-multiple-progress'
16-
Vue.use('VmProgress', Progress)
16+
# Vue.component('vm-progress', Progress) # 可以指定组件名称
17+
Vue.use(Progress) # 组件名称 `vm-progress`
1718
```
1819

1920
For more information, please refer to [Progress](https://vue-multiple.github.io/progress) in our documentation.

example/src/main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import Vue from 'vue'
22
import App from './App.vue'
33

44
import Progress from '../../src/index.js'
5-
Vue.component(Progress.name, Progress)
5+
// Vue.component('vm-progress', Progress)
6+
Vue.use(Progress)
67

78
import VueDemonstration from 'vue-demonstration'
89
Vue.component('demonstration', VueDemonstration)

src/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ if (typeof window !== 'undefined' && window.Vue) {
1010
Vue.component('VmProgress', Progress)
1111
}
1212

13+
Progress.install = install
14+
1315
export default Progress

0 commit comments

Comments
 (0)