File tree Expand file tree Collapse file tree 3 files changed +18
-22
lines changed
Expand file tree Collapse file tree 3 files changed +18
-22
lines changed Original file line number Diff line number Diff line change @@ -12,20 +12,21 @@ $ yarn add vue-scroll-indicator --dev
1212$ npm i vue-scroll-indicator --save-dev
1313```
1414
15- #### Setup :
15+ Register the component :
1616
1717``` javascript
18- // register the plugin
19- import Vue from ' vue'
20- import VueScrollIndicator from ' vue-scroll-indicator'
18+ import Vue from ' vue' ;
19+ import { VueScrollIndicator } from ' vue-scroll-indicator' ;
2120
22- Vue .use (VueScrollIndicator)
21+ Vue .component (' vue-scroll-indicator' , VueScrollIndicator);
22+ ```
23+
24+ Alternatively using ` Vue.use() ` to register the component:
2325
24- // ... or register the component manually
25- import Vue from ' vue'
26- import { VueScrollIndicator } from ' vue-scroll-indicator'
26+ ``` javascript
27+ import VueScrollIndicator from ' vue-scroll-indicator' ;
2728
28- Vue .component ( ' vue-scroll-indicator ' , VueScrollIndicator)
29+ Vue .use ( VueScrollIndicator);
2930```
3031
3132## Usage
Original file line number Diff line number Diff line change 11{
22 "name" : " vue-scroll-indicator" ,
33 "description" : " Scroll indicator component using Vue.js" ,
4- "version" : " 0.0.4 " ,
4+ "version" : " 0.0.5 " ,
55 "author" : " Robbin Johansson <robbinfellow@gmail.com>" ,
66 "main" : " dist/vue-scroll-indicator.js" ,
77 "homepage" : " https://github.com/robbinfellow/vue-scroll-indicator#readme" ,
Original file line number Diff line number Diff line change 1- import VueScrollIndicator from './components/VueScrollIndicator.vue'
1+ import VueScrollIndicator from './components/VueScrollIndicator.vue' ;
22
3- const plugin = {
4- install : Vue => {
5- Vue . component ( 'vue-scroll-indicator' , VueScrollIndicator )
6- }
7- }
3+ export default {
4+ install ( Vue , options ) {
5+ Vue . component ( 'vue-scroll-indicator' , VueScrollIndicator ) ;
6+ } ,
7+ } ;
88
9- // Automatic installation if Vue has been added to the global scope.
10- if ( typeof window !== 'undefined' && window . Vue ) {
11- window . Vue . use ( plugin )
12- }
9+ export { VueScrollIndicator } ;
1310
14- export default plugin
15- export { VueScrollIndicator }
You can’t perform that action at this time.
0 commit comments