Skip to content

Commit e468813

Browse files
zhenzhenChangezhenzhenChange
and
zhenzhenChange
authored
fix: adding examples and modifying parameter descriptions (#522) (#523)
Co-authored-by: zhenzhenChange <[email protected]>
1 parent 3b0492a commit e468813

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

src/api/global-api.md

+13-4
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ const AsyncComp = defineAsyncComponent({
192192
// The error component will be displayed if a timeout is
193193
// provided and exceeded. Default: Infinity.
194194
timeout: 3000,
195-
// Defining if component is suspensible
195+
// Defining if component is suspensible. Default: true.
196196
suspensible: false,
197197
/**
198198
*
@@ -201,7 +201,16 @@ const AsyncComp = defineAsyncComponent({
201201
* @param {*} fail End of failure
202202
* @param {*} attempts Maximum allowed retries number
203203
*/
204-
onError(error, retry, fail, attempts) {},
204+
onError(error, retry, fail, attempts) {
205+
if (error.message.match(/fetch/) && attempts <= 3) {
206+
// retry on fetch errors, 3 max attempts
207+
retry()
208+
} else {
209+
// Note that retry/fail are like resolve/reject of a promise:
210+
// one of them must be called for the error handling to continue.
211+
fail()
212+
}
213+
},
205214
})
206215
```
207216

@@ -233,9 +242,9 @@ render() {
233242

234243
### Arguments
235244

236-
Accepts one argument: `component`
245+
Accepts one argument: `name`
237246

238-
#### component
247+
#### name
239248

240249
- **Type:** `String`
241250

0 commit comments

Comments
 (0)