Skip to content

Commit 584bc1a

Browse files
committed
docs(useFetch): Fixing demo for storybook
1 parent f6de30e commit 584bc1a

File tree

1 file changed

+3
-19
lines changed

1 file changed

+3
-19
lines changed

src/functions/useFetch/stories/UseFetchDemo.vue

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,10 @@
1313
:disabled="isLoading"
1414
v-text="`Fetch with failure`"
1515
/>
16-
<button
17-
class="button is-danger"
18-
@click="stop"
19-
:disabled="!isLoading"
20-
v-text="`Abort fetch`"
21-
/>
2216
</div>
2317

24-
<!-- isAborted -->
25-
<use-fetch-demo-table status="Aborted" v-if="isAborted">
26-
Resource fetch aborted with status code
27-
<strong>{{ status }}</strong> and message
28-
<strong>{{ statusText }}</strong>
29-
</use-fetch-demo-table>
30-
3118
<!-- isFailed -->
32-
<use-fetch-demo-table status="Failed" v-else-if="isFailed">
19+
<use-fetch-demo-table status="Failed" v-if="isFailed">
3320
Resource fetch failed with status code
3421
<strong>{{ status }}</strong> and message
3522
<strong>{{ statusText }}</strong>
@@ -71,16 +58,14 @@ export default Vue.extend({
7158
components: { UseFetchDemoTable },
7259
setup() {
7360
const isInit = ref(false)
74-
const delayUrl = 'http://deelay.me/2000'
75-
const randomDogUrl = `${delayUrl}/https://dog.ceo/api/breeds/image/random`
61+
const randomDogUrl = 'https://dog.ceo/api/breeds/image/random'
7662
const url = ref(randomDogUrl)
7763
const {
7864
data,
7965
status,
8066
statusText,
8167
isLoading,
8268
isFailed,
83-
isAborted,
8469
start,
8570
stop
8671
} = useFetch(url, {}, false)
@@ -93,7 +78,7 @@ export default Vue.extend({
9378
9479
const startWithFailed = () => {
9580
isInit.value = true
96-
url.value = `${delayUrl}/https://dog.ceo`
81+
url.value = 'https://dog.ceo'
9782
start()
9883
}
9984
@@ -104,7 +89,6 @@ export default Vue.extend({
10489
isInit,
10590
isLoading,
10691
isFailed,
107-
isAborted,
10892
startWithSuccess,
10993
startWithFailed,
11094
stop

0 commit comments

Comments
 (0)