diff --git a/docs/index.html b/docs/index.html index 32cffe2..f2de859 100644 --- a/docs/index.html +++ b/docs/index.html @@ -5,8 +5,9 @@ - VuePromised - + VuePromised + + @@ -36,7 +40,9 @@ - + + +
@@ -51,33 +57,38 @@
-
-
-

Single promise

+
+
+

Single promise

-
+
- -
-
- -
#{{ data.num }} - {{ data.title }}
-
-
- Error: {{ error.message }} -
-
+ + +
+
+ +
#{{ data.num }} - {{ data.title }}
+
+
+ Error: {{ error.message }} +
+
+

Multiple promises

+ psst, I need help to improve the API, see #4 to help +
+ @@ -85,19 +96,22 @@

Multiple promises

- -
-
-

{{ items.length }} promises resolved

-
- -
#{{ item.num }} - {{ item.title }}
-
-
-
- Failed {{ errors.length }} promises -
-
+ + +
+
+

{{ items.length }} promises resolved

+
+ +
#{{ item.num }} - {{ item.title }}
+
+
+
+ Failed {{ errors.length }} promises +
+
+
+
+ + diff --git a/docs/index.js b/docs/index.js index 6db06cb..73061b8 100644 --- a/docs/index.js +++ b/docs/index.js @@ -1,4 +1,4 @@ -/* global Vue, VuePromised, axios */ +/* global Vue, VuePromised, axios, PrismComponent */ // eslint-disable-next-line const delay = (t, value) => new Promise(r => setTimeout(r.bind(null, value), t)) @@ -11,6 +11,27 @@ function getRandomImage (max) { .then(res => res.data) } +Vue.component('DemoCode', { + template: '#demo-code', + props: { + code: String, + }, + + data () { + return { + showCode: false, + } + }, + + computed: { + seeLabel () { + return this.showCode ? 'See demo' : 'See code' + }, + }, + + components: { Prism: PrismComponent }, +}) + // eslint-disable-next-line new Vue({ el: '#app', @@ -18,6 +39,36 @@ new Vue({ data: () => ({ promise: null, promises: [], + + samples: { + single: `\ + +
+
+ +
#{{ data.num }} - {{ data.title }}
+
+
+ Error: {{ error.message }} +
+
+`, + multiple: `\ + +
+
+

{{ items.length }} promises resolved

+
+ +
#{{ item.num }} - {{ item.title }}
+
+
+
+ Failed {{ errors.length }} promises +
+
+` + }, }), created () {