docs: add api anchor (#55495)

* docs: add docs anchor for RequestOptions

* update
This commit is contained in:
lijianan
2025-10-27 14:20:26 +08:00
committed by GitHub
parent 26c3b09eeb
commit e1ff71744e
3 changed files with 7 additions and 6 deletions

View File

@@ -189,6 +189,7 @@ const Transfer = <RecordType extends TransferItem = TransferItem>(
KeyWise<RecordType>,
TransferKey
>((item) => item.key);
const [rightMultipleSelect, updateRightPrevSelectedIndex] = useMultipleSelect<
KeyWise<RecordType>,
TransferKey

View File

@@ -53,7 +53,7 @@ Common props ref[Common props](/docs/react/common-props)
| accept | File types that can be accepted. See [input accept Attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept) | string | - | |
| action | Uploading URL | string \| (file) => Promise&lt;string> | - | |
| beforeUpload | Hook function which will be executed before uploading. Uploading will be stopped with `false` or a rejected Promise returned. When returned value is `Upload.LIST_IGNORE`, the list of files that have been uploaded will ignore it. **Warningthis function is not supported in IE9** | (file, fileList) => boolean \| Promise&lt;File> \| `Upload.LIST_IGNORE` | - | |
| customRequest | Override for the default xhr behavior allowing for additional customization and the ability to implement your own XMLHttpRequest | ( options: [RequestOptions](#requestoptions), info: { defaultRequest: (option: [RequestOptions](#requestoptions)) => void; } ) => void | - | defaultRequest: 5.28.0 |
| customRequest | Override for the default xhr behavior allowing for additional customization and the ability to implement your own XMLHttpRequest | ( options: [RequestOptions](#request-options), info: { defaultRequest: (option: [RequestOptions](#request-options)) => void; } ) => void | - | defaultRequest: 5.28.0 |
| data | Uploading extra params or function which can return uploading extra params | object \| (file) => object \| Promise&lt;object> | - | |
| defaultFileList | Default list of files that have been uploaded | object\[] | - | |
| directory | Support upload whole directory ([caniuse](https://caniuse.com/#feat=input-file-directory)) | boolean | false | |
@@ -94,7 +94,7 @@ Extends File with additional props.
| uid | unique id. Will auto-generate when not provided | string | - | - |
| url | Download url | string | - | - |
### RequestOptions
### RequestOptions {#request-options}
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
@@ -105,7 +105,7 @@ Extends File with additional props.
| withCredentials | The ajax upload with cookie sent | boolean | - | - |
| headers | Set request headers, valid above IE10 | Record<string, string> | - | - |
| method | The http method of upload request | string | - | - |
| onProgress | Progress event callback | (event: object, file:UploadFile ) => void | - | - |
| onProgress | Progress event callback | (event: object, file: UploadFile) => void | - | - |
| onError | Error callback when upload fails | (event: object, body?: object) => void | - | - |
| onSuccess | Success callback when upload completes | (body: object, fileOrXhr?: UploadFile \| XMLHttpRequest) => void | - | - |

View File

@@ -54,7 +54,7 @@ demo:
| accept | 接受上传的文件类型,详见 [input accept Attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept) | string | - | |
| action | 上传的地址 | string \| (file) => Promise&lt;string> | - | |
| beforeUpload | 上传文件之前的钩子,参数为上传的文件,若返回 `false` 则停止上传。支持返回一个 Promise 对象Promise 对象 reject 时则停止上传resolve 时开始上传( resolve 传入 `File``Blob` 对象则上传 resolve 传入对象);也可以返回 `Upload.LIST_IGNORE`,此时列表中将不展示此文件。 **注意IE9 不支持该方法** | (file, fileList) => boolean \| Promise&lt;File> \| `Upload.LIST_IGNORE` | - | |
| customRequest | 通过覆盖默认的上传行为,可以自定义自己的上传实现 | ( options: [RequestOptions](#requestoptions), info: { defaultRequest: (option: [RequestOptions](#requestoptions)) => void; } ) => void | - | defaultRequest: 5.28.0 |
| customRequest | 通过覆盖默认的上传行为,可以自定义自己的上传实现 | ( options: [RequestOptions](#request-options), info: { defaultRequest: (option: [RequestOptions](#request-options)) => void; } ) => void | - | defaultRequest: 5.28.0 |
| data | 上传所需额外参数或返回上传额外参数的方法 | object\|(file) => object \| Promise&lt;object> | - | |
| defaultFileList | 默认已经上传的文件列表 | object\[] | - | |
| directory | 支持上传文件夹([caniuse](https://caniuse.com/#feat=input-file-directory) | boolean | false | |
@@ -95,7 +95,7 @@ demo:
| uid | 唯一标识符,不设置时会自动生成 | string | - | - |
| url | 下载地址 | string | - | - |
### RequestOptions
### RequestOptions {#request-options}
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
@@ -106,7 +106,7 @@ demo:
| withCredentials | 上传请求时是否携带 cookie | boolean | - | - |
| headers | 上传的请求头部 | Record<string, string> | - | - |
| method | 上传请求的 http method | string | - | - |
| onProgress | 上传进度回调 | (event: object, file:UploadFile ) => void | - | - |
| onProgress | 上传进度回调 | (event: object, file: UploadFile) => void | - | - |
| onError | 上传失败回调 | (event: object, body?: object) => void | - | - |
| onSuccess | 上传成功回调 | (body: object, fileOrXhr?: UploadFile \| XMLHttpRequest) => void | - | - |