-
Notifications
You must be signed in to change notification settings - Fork 186
feat(FilesCard): 添加previewTeleported属性,支持将预览图片弹窗teleport到body下 #311
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -32,28 +32,29 @@ | |||||
|
|
||||||
| ## 属性 | ||||||
|
|
||||||
| | 属性名 | 类型 | 是否必填 | 默认值 | 描述 | | ||||||
| | ---------------- | ---------------------------------- | -------- | ------------- | ------------------------------------------------------------------ | | ||||||
| | `uid` | `string \| number` | 是 | | 文件唯一标识符 | | ||||||
| | `name` | `string` | 否 | `undefined` | 文件名(支持自动解析后缀匹配图标) | | ||||||
| | `fileSize` | `number` | 否 | `undefined` | 文件大小(单位:字节,自动转换为易读格式) | | ||||||
| | `fileType` | `string` | 否 | `undefined` | 文件类型(优先级高于 `name` 后缀解析,如 `'image'`、`'document'`) | | ||||||
| | `description` | `string` | 否 | `undefined` | 描述文本(支持动态生成文件类型和大小信息) | | ||||||
| | `url` | `string` | 否 | `undefined` | 文件访问地址(图片文件可用于预览) | | ||||||
| | `thumbUrl` | `string` | 否 | `undefined` | 图片缩略图地址 | | ||||||
| | `imgFile` | `File \| Blob` | 否 | `undefined` | 图片文件流(自动解析为预览地址,仅用于上传前临时展示) | | ||||||
| | `iconSize` | `string` | 否 | `'42px'` | 图标/图片尺寸 | | ||||||
| | `iconColor` | `string` | 否 | `undefined` | 非图片文件的图标颜色(支持自定义色值) | | ||||||
| | `showDelIcon` | `boolean` | 否 | `false` | 是否显示悬停删除图标 | | ||||||
| | `maxWidth` | `string` | 否 | `'236px'` | 卡片最大宽度 | | ||||||
| | `style` | `CSSProperties` | 否 | `undefined` | 卡片自定义样式 | | ||||||
| | `hoverStyle` | `CSSProperties` | 否 | `undefined` | 卡片悬停时的自定义样式 | | ||||||
| | `imgVariant` | `'rectangle' \| 'square'` | 否 | `'rectangle'` | 图片卡片形态(长方形/正方形) | | ||||||
| | `imgPreview` | `boolean` | 否 | `true` | 是否开启图片预览功能 | | ||||||
| | `imgPreviewMask` | `boolean` | 否 | `true` | 是否显示图片预览遮罩蒙层 | | ||||||
| | `status` | `'uploading' \| 'done' \| 'error'` | 否 | `undefined` | 文件状态(控制进度条、错误提示等视觉反馈) | | ||||||
| | `percent` | `number` | 否 | `0` | 上传进度百分比(配合 `status="uploading"` 使用) | | ||||||
| | `errorTip` | `string` | 否 | `'上传失败'` | 错误状态自定义提示文本 | | ||||||
| | 属性名 | 类型 | 是否必填 | 默认值 | 描述 | | ||||||
| | ------------------- | ---------------------------------- | -------- | ------------- | ----------------------------------------------------------------------------------------- | | ||||||
| | `uid` | `string \| number` | 是 | | 文件唯一标识符 | | ||||||
| | `name` | `string` | 否 | `undefined` | 文件名(支持自动解析后缀匹配图标) | | ||||||
| | `fileSize` | `number` | 否 | `undefined` | 文件大小(单位:字节,自动转换为易读格式) | | ||||||
| | `fileType` | `string` | 否 | `undefined` | 文件类型(优先级高于 `name` 后缀解析,如 `'image'`、`'document'`) | | ||||||
| | `description` | `string` | 否 | `undefined` | 描述文本(支持动态生成文件类型和大小信息) | | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fileType 示例值不准确(含有不存在的 'document')。 类型联合中没有 'document'。请使用实际可用的取值,或移除该示例以免误导使用者。 -| `fileType` | `string` | 否 | `undefined` | 文件类型(优先级高于 `name` 后缀解析,如 `'image'`、`'document'`) |
+| `fileType` | `string` | 否 | `undefined` | 文件类型(优先级高于 `name` 后缀解析;可选:`'word'`、`'excel'`、`'ppt'`、`'pdf'`、`'txt'`、`'mark'`、`'image'`、`'audio'`、`'video'`、`'three'`、`'code'`、`'database'`、`'link'`、`'zip'`、`'file'`、`'unknown'`) |📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| | `url` | `string` | 否 | `undefined` | 文件访问地址(图片文件可用于预览) | | ||||||
| | `thumbUrl` | `string` | 否 | `undefined` | 图片缩略图地址 | | ||||||
| | `imgFile` | `File \| Blob` | 否 | `undefined` | 图片文件流(自动解析为预览地址,仅用于上传前临时展示) | | ||||||
| | `iconSize` | `string` | 否 | `'42px'` | 图标/图片尺寸 | | ||||||
| | `iconColor` | `string` | 否 | `undefined` | 非图片文件的图标颜色(支持自定义色值) | | ||||||
| | `showDelIcon` | `boolean` | 否 | `false` | 是否显示悬停删除图标 | | ||||||
| | `maxWidth` | `string` | 否 | `'236px'` | 卡片最大宽度 | | ||||||
| | `style` | `CSSProperties` | 否 | `undefined` | 卡片自定义样式 | | ||||||
| | `hoverStyle` | `CSSProperties` | 否 | `undefined` | 卡片悬停时的自定义样式 | | ||||||
| | `imgVariant` | `'rectangle' \| 'square'` | 否 | `'rectangle'` | 图片卡片形态(长方形/正方形) | | ||||||
| | `imgPreview` | `boolean` | 否 | `true` | 是否开启图片预览功能 | | ||||||
| | `imgPreviewMask` | `boolean` | 否 | `true` | 是否显示图片预览遮罩蒙层 | | ||||||
| | `previewTeleported` | `boolean` | 否 | `false` | image-viewer 是否插入至 body 元素上。 嵌套的父元素属性会发生修改时应该将此属性设置为 true | | ||||||
| | `status` | `'uploading' \| 'done' \| 'error'` | 否 | `undefined` | 文件状态(控制进度条、错误提示等视觉反馈) | | ||||||
| | `percent` | `number` | 否 | `0` | 上传进度百分比(配合 `status="uploading"` 使用) | | ||||||
| | `errorTip` | `string` | 否 | `'上传失败'` | 错误状态自定义提示文本 | | ||||||
|
|
||||||
| ## 插槽 | ||||||
|
|
||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Invalid example value for fileType (“document”).
The union in code does not include 'document'. Replace with valid options or remove the example to avoid misleading users.
Apply this diff (one option):
📝 Committable suggestion
🤖 Prompt for AI Agents