You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+39-10
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,37 @@
1
1
# Laravel Component Loading
2
2
3
-
by bubbleflat.com
3
+
by [bubbleflat.com]()
4
4
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.
6
8
7
9
## Installation
8
10
9
-
TODO
11
+
````
12
+
npm install vue-component-loading
13
+
````
14
+
15
+
```javascript
16
+
importVueLoadingfrom'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
10
35
11
36
## Usage
12
37
@@ -19,22 +44,22 @@ First, register your progressbar :
19
44
</template>
20
45
```
21
46
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
23
48
24
49
```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
28
53
```
29
54
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
31
56
32
57
## Exemple
33
58
34
59
```html
35
60
<template>
36
61
<divv-if="!loading">
37
-
Component Loading !
62
+
Component Loaded !
38
63
</div>
39
64
</template>
40
65
<script>
@@ -51,4 +76,8 @@ According to this state, you can access `loading` data in your component
51
76
}
52
77
53
78
</script>
54
-
```
79
+
```
80
+
81
+
## License
82
+
83
+
[The MIT License](https://opensource.org/licenses/MIT)
0 commit comments