Skip to content

Commit f6d100c

Browse files
committed
docs: fix docs context
1 parent 23ed042 commit f6d100c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/hooks/src/useRequest/docs/basic/index.en-US.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ const {
185185
| error | Exception thrown by service | `Ref<Error>` \| `undefined` |
186186
| loading | Is the service being executed | `Ref<boolean>` |
187187
| params | An array of parameters for the service being executed. For example, you triggered `run(1, 2, 3)`, then params is equal to `[1, 2, 3]` | `Ref<TParams | []>` |
188-
| initialData | Init data | `TData` \| `undefined` |
189188
| run | <ul><li> Manually trigger the execution of the service, and the parameters will be passed to the service</li><li>Automatic handling of exceptions, feedback through `onError`</li></ul> | `(...params: TParams) => void` |
190189
| runAsync | The usage is the same as `run`, but it returns a Promise, so you need to handle the exception yourself. | `(...params: TParams) => Promise<TData>` |
191190
| refresh | Use the last params, call `run` again | `() => void` |
@@ -197,6 +196,7 @@ const {
197196

198197
| Property | Description | Type | Default |
199198
| --- | --- | --- | --- |
199+
| initialData | Init data | `TData` \| `undefined` |
200200
| manual | <ul><li> The default is `false`. That is, the service is automatically executed during initialization.</li><li>If set to `true`, you need to manually call `run` or `runAsync` to trigger execution. </li></ul> | `boolean` | `false` |
201201
| defaultParams | The parameters passed to the service at the first default execution | `TParams` | - |
202202
| formatResult | Format the request results, which recommend to use `useFormatResult` | `(response: TData) => any` | - |

packages/hooks/src/useRequest/docs/basic/index.zh-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ const {
182182
| error | service 抛出的异常 | `Ref<Error>` \| `undefined` |
183183
| loading | service 是否正在执行 | `Ref<boolean>` |
184184
| params | 当次执行的 service 的参数数组。比如你触发了 `run(1, 2, 3)`,则 params 等于 `[1, 2, 3]` | `Ref<TParams | []>` |
185-
| initialData | 初始化的数据 | `TData` \| `undefined` |
186185
| run | <ul><li> 手动触发 service 执行,参数会传递给 service</li><li>异常自动处理,通过 `onError` 反馈</li></ul> | `(...params: TParams) => void` |
187186
| runAsync |`run` 用法一致,但返回的是 Promise,需要自行处理异常。 | `(...params: TParams) => Promise<TData>` |
188187
| refresh | 使用上一次的 params,重新调用 `run` | `() => void` |
@@ -194,6 +193,7 @@ const {
194193

195194
| 参数 | 说明 | 类型 | 默认值 |
196195
| --- | --- | --- | --- |
196+
| initialData | 初始化的数据 | `TData` \| `undefined` |
197197
| manual | <ul><li> 默认 `false`。 即在初始化时自动执行 service。</li><li>如果设置为 `true`,则需要手动调用 `run``runAsync` 触发执行。 </li></ul> | `boolean` | `false` |
198198
| defaultParams | 首次默认执行时,传递给 service 的参数 | `TParams` | - |
199199
| formatResult | 格式化请求结果,建议使用 `useFormatResult` | `(response: TData) => any` | - |

0 commit comments

Comments
 (0)