Skip to content

Commit 7a42a59

Browse files
Improve documentation
1 parent 301b5a4 commit 7a42a59

File tree

2 files changed

+61
-13
lines changed

2 files changed

+61
-13
lines changed

README.md

+39-10
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,37 @@
11
# Laravel Component Loading
22

3-
by bubbleflat.com
3+
by [bubbleflat.com]()
44

5-
TODO Description
5+
This package allows you to manage a loading state inside all component, and to display a progressbar (thanks to [vue-progressbar](https://github.com/hilongjw/vue-progressbar)) to show the global loading state of your app.
6+
7+
All components have their own loading state, but the progressbar show the global loading state of all components.
68

79
## Installation
810

9-
TODO
11+
````
12+
npm install vue-component-loading
13+
````
14+
15+
```javascript
16+
import VueLoading from 'vue-component-loading'
17+
18+
let config = {
19+
progressBar:{
20+
color: '#000',
21+
failedColor: '#874b4b',
22+
thickness: '5px',
23+
transition: {
24+
speed: '0.2s',
25+
opacity: '0.6s',
26+
termination: 300
27+
},
28+
}
29+
}
30+
31+
Vue.use(VueLoading, config);
32+
```
33+
34+
See [progressbar doc](https://github.com/hilongjw/vue-progressbar#constructor-options) for all options for the progressbar
1035

1136
## Usage
1237

@@ -19,22 +44,22 @@ First, register your progressbar :
1944
</template>
2045
```
2146

22-
In a component you can use to manage the loading state of your component
47+
You can use these methods inside a component to manage its loading state
2348

2449
```javascript
25-
this.startLoading();
26-
this.endLoading();
27-
this.failLoading();
50+
this.startLoading(); // --> this.loading = true : the component starts to load, the progressbar appear
51+
this.endLoading(); // --> this.loading = false : the component end to load, the progressbar progress :p (if it's the last component, it disappear)
52+
this.failLoading(); // --> this.loading = false : show the fail progressbar
2853
```
2954

30-
According to this state, you can access `loading` data in your component
55+
Depending on the loading state, you can access `loading` boolean in your component
3156

3257
## Exemple
3358

3459
```html
3560
<template>
3661
<div v-if="!loading">
37-
Component Loading !
62+
Component Loaded !
3863
</div>
3964
</template>
4065
<script>
@@ -51,4 +76,8 @@ According to this state, you can access `loading` data in your component
5176
}
5277
5378
</script>
54-
```
79+
```
80+
81+
## License
82+
83+
[The MIT License](https://opensource.org/licenses/MIT)

package.json

+22-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,32 @@
11
{
22
"name": "vue-component-loading",
33
"version": "1.0.0",
4-
"description": "Vuejs package to use a loading boolean inside a component",
4+
"description": "Vuejs package, allow you to manage a loading state inside all component, and to display a progressbar",
55
"main": "src/index.js",
66
"scripts": {
77
"test": "echo \"Error: no test specified\" && exit 1"
88
},
9-
"author": "val-bubbleflat",
10-
"license": "ISC",
9+
"author": {
10+
"name": "Valentin Vivies - Bubbleflat",
11+
"email": "[email protected]",
12+
"url": "https://bubbleflat.com"
13+
},
14+
"repository": {
15+
"type": "git",
16+
"url": "https://github.com/val-bubbleflat/vue-component-loading"
17+
},
18+
"keywords": [
19+
"vue",
20+
"vue-component-loading",
21+
"vue loading",
22+
"progressbar",
23+
"vue progressbar"
24+
],
25+
"license": "MIT",
26+
"bugs": {
27+
"url": "https://github.com/val-bubbleflat/vue-component-loading/issues"
28+
},
29+
"homepage": "https://github.com/val-bubbleflat/vue-component-loading#readme",
1130
"dependencies": {
1231
"vue-progressbar": "^0.7.3"
1332
}

0 commit comments

Comments
 (0)