Skip to content

fix: adding examples and modifying parameter descriptions (#522) #523

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions src/api/global-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ const AsyncComp = defineAsyncComponent({
// The error component will be displayed if a timeout is
// provided and exceeded. Default: Infinity.
timeout: 3000,
// Defining if component is suspensible
// Defining if component is suspensible. Default: true.
suspensible: false,
/**
*
Expand All @@ -201,7 +201,16 @@ const AsyncComp = defineAsyncComponent({
* @param {*} fail End of failure
* @param {*} attempts Maximum allowed retries number
*/
onError(error, retry, fail, attempts) {},
onError(error, retry, fail, attempts) {
if (error.message.match(/fetch/) && attempts <= 3) {
// retry on fetch errors, 3 max attempts
retry()
} else {
// Note that retry/fail are like resolve/reject of a promise:
// one of them must be called for the error handling to continue.
fail()
}
},
})
```

Expand Down Expand Up @@ -233,9 +242,9 @@ render() {

### Arguments

Accepts one argument: `component`
Accepts one argument: `name`

#### component
#### name

- **Type:** `String`

Expand Down