You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Options except `loader` and `suspensible` works exactly the same as in 2.x.
79
+
- The `delay` and `timeout` options work exactly the same as 2.x.
78
80
79
81
**Difference from 2.x:**
80
82
81
-
The `component` option is replaced by the new `loader` option, which accepts the same loader function as in the simple usage.
83
+
-The `component` option is replaced by the new `loader` option, which accepts the same loader function as in the simple usage.
82
84
83
-
In 2.x, an async component with options is defined as
85
+
In 2.x, an async component with options is defined as
84
86
85
-
```ts
86
-
() => ({
87
-
component: Promise<Component>
88
-
// ...other options
89
-
})
90
-
```
87
+
```ts
88
+
() => ({
89
+
component: Promise<Component>
90
+
// ...other options
91
+
})
92
+
```
91
93
92
-
Whereas in 3.x it is now:
94
+
Whereas in 3.x it is now:
93
95
94
-
```ts
95
-
defineAsyncComponent({
96
-
loader: () =>Promise<Component>
97
-
// ...other options
98
-
})
99
-
```
96
+
```ts
97
+
defineAsyncComponent({
98
+
loader: () =>Promise<Component>
99
+
// ...other options
100
+
})
101
+
```
102
+
103
+
- 2.x `loading` and `error` options are renamed to `loadingComponent` and `errorComponent` respectively to be more explicit.
104
+
105
+
## Retry Control
106
+
107
+
The new `retryWhen` option expects a function that returns a boolean indicating whether the async component should retry when the loader promise rejects. The function receives the rejection error as the argument so it can conditionally retry only on certain types of errors.
108
+
109
+
The `maxRetries` option determines how many retries are allowed (default: `3`). When max times of retries have been attempted, the component will go into error state (render the `errorComponent` if provided) with the last failed error.
0 commit comments