13
13
:disabled =" isLoading"
14
14
v-text =" `Fetch with failure`"
15
15
/>
16
- <button
17
- class =" button is-danger"
18
- @click =" stop"
19
- :disabled =" !isLoading"
20
- v-text =" `Abort fetch`"
21
- />
22
16
</div >
23
17
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
-
31
18
<!-- isFailed -->
32
- <use-fetch-demo-table status =" Failed" v-else- if =" isFailed" >
19
+ <use-fetch-demo-table status =" Failed" v-if =" isFailed" >
33
20
Resource fetch failed with status code
34
21
<strong >{{ status }}</strong > and message
35
22
<strong >{{ statusText }}</strong >
@@ -71,16 +58,14 @@ export default Vue.extend({
71
58
components: { UseFetchDemoTable },
72
59
setup() {
73
60
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'
76
62
const url = ref (randomDogUrl )
77
63
const {
78
64
data,
79
65
status,
80
66
statusText,
81
67
isLoading,
82
68
isFailed,
83
- isAborted,
84
69
start,
85
70
stop
86
71
} = useFetch (url , {}, false )
@@ -93,7 +78,7 @@ export default Vue.extend({
93
78
94
79
const startWithFailed = () => {
95
80
isInit .value = true
96
- url .value = ` ${ delayUrl }/ https://dog.ceo`
81
+ url .value = ' https://dog.ceo'
97
82
start ()
98
83
}
99
84
@@ -104,7 +89,6 @@ export default Vue.extend({
104
89
isInit ,
105
90
isLoading ,
106
91
isFailed ,
107
- isAborted ,
108
92
startWithSuccess ,
109
93
startWithFailed ,
110
94
stop
0 commit comments