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
+62Lines changed: 62 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,66 @@ Multiple Process Loader Management for [Vue](http://vuejs.org/) and (optionally)
16
16
17
17
**vue-wait** helps to manage multiple loading states on the page without any conflict. It's based on a **very simple idea** that manages an array (or Vuex store optionally) with multiple loading states. The **built-in loader component** listens its registered loader and immediately become loading state.
18
18
19
+
# ⏩Quick Start
20
+
21
+
1. Install:
22
+
```bash
23
+
yarn add vue-wait
24
+
```
25
+
26
+
2. Require:
27
+
```js
28
+
importVueWaitfrom'vue-wait'
29
+
30
+
Vue.use(VueWait)
31
+
32
+
newVue({
33
+
// your vue config
34
+
wait:newVueWait(),
35
+
})
36
+
```
37
+
38
+
3. Use in Your Components
39
+
40
+
```js
41
+
<template>
42
+
<v-wait for="my list is to load">
43
+
<template slot="waiting">
44
+
<div>
45
+
<img src="loading.gif"/>
46
+
Loading the list...
47
+
</div>
48
+
</template>
49
+
<ul>
50
+
<li v-for="item in myList">{{ item }}</li>
51
+
</ul>
52
+
</v-wait>
53
+
</template>
54
+
55
+
<script>
56
+
exportdefault {
57
+
data() {
58
+
return {
59
+
myList: []
60
+
}
61
+
},
62
+
asynccreated() {
63
+
// start waiting
64
+
this.$wait.start('my list is to load');
65
+
66
+
this.myList=awaitfetch('/my-list-url');
67
+
68
+
// stop waiting
69
+
this.$wait.end('my list is to load');
70
+
},
71
+
};
72
+
</script>
73
+
```
74
+
75
+
**vue-wait has more abilities to make the management easier, please read the complete documentation.**
76
+
77
+
# ▶️Detailed Start
78
+
19
79
## 📦 Requirements
20
80
21
81
-[Vue.js](https://vuejs.org) (v2.0.0+)
@@ -385,6 +445,8 @@ By default `waitFor` return async function, if you want to wrap default sync fun
0 commit comments