Attachments输入附件
Attachments
输入附件
用于展示一组附件信息集合。
使用import { Attachments } from "@ant-design/x"; |
文档 编辑此页... |
Attachments 组件用于需要展示一组附件信息集合的场景。
通用属性参考:通用属性。
继承 antd Upload 属性。
| 属性 | 说明 | 类型 | 默认值 | 版本 |
|---|---|---|---|---|
| classNames | 自定义样式类名,见下 | Record<string, string> | - | - |
| disabled | 是否禁用 | boolean | false | - |
| getDropContainer | 设置拖拽时,可以释放文件的区域 | () => HTMLElement | - | - |
| items | 附件列表,同 Upload fileList | Attachment[] | - | - |
| overflow | 文件列表超出时样式 | 'wrap' | 'scrollX' | 'scrollY' | - | - |
| placeholder | 没有文件时的占位信息 | PlaceholderType | ((type: 'inline' | 'drop') => PlaceholderType) | - | - |
| rootClassName | 根节点的样式类名 | string | - | - |
| styles | 自定义样式对象,见下 | Record<string, React.CSSProperties> | - | - |
| imageProps | 图片属性,同 antd Image 属性 | ImageProps | - | - |
interface PlaceholderType {icon?: React.ReactNode;title?: React.ReactNode;description?: React.ReactNode;}
| 属性 | 说明 | 类型 | 版本 |
|---|---|---|---|
| nativeElement | 获取原生节点 | HTMLElement | - |
| fileNativeElement | 获取文件上传原生节点 | HTMLElement | - |
| upload | 手工调用上传文件 | (file: File) => void | - |
| select | 手工调用选择文件 | (options: { accept?: string; multiple?: boolean; }) => void | - |
| Token 名称 | 描述 | 类型 | 默认值 |
|---|---|---|---|
| colorBgPlaceholderHover | string | rgba(255,255,255,0.85) |