Basic Components
Gallery Images
Component for displaying multiple images with upload capability
Usage Examples
Basic Usage
Display a group of images with the ability to upload new ones, supports drag and drop uploads
300px
Read-Only Mode
Display images without the option to upload
300px
Upload Control
Demonstrates how to handle the image upload process and states
300px
Properties
Property | Basic component module for translation keys shared across all component documentation pages | Type | Default |
---|---|---|---|
images | Array of image objects | Array | [] |
allowUpload | Whether to allow uploading new images | Boolean | false |
Events
Event | Basic component module for translation keys shared across all component documentation pages | Parameters |
---|---|---|
upload | Triggered when the upload button is clicked or files are dropped, provides array of file and ID objects | fileItems: Array<{file: File, id: String}> |
update:images | Triggered when the image list is updated, with the updated images array as parameter | images: Array |
Data Format
Image Object Format
Specification for image objects accepted by the component, including both completed uploads and in-progress uploads
// 已上传完成的图片
{
id: string, // 图片唯一ID
thumbnailUrl: string, // 缩略图URL
previewUrl: string, // 预览图URL
originalUrl: string, // 原图URL
filename?: string, // 文件名(可选)
filesize?: string, // 文件大小(可选)
imageSize?: string // 图片尺寸(可选)
}
// 上传中的图片
{
id: string, // 图片唯一ID
dataUrl: string, // 图片数据URL (base64或URL)
filename?: string, // 文件名(可选)
filesize?: string, // 文件大小(可选)
imageSize?: string, // 图片尺寸(可选)
progress: number, // 上传进度 (0-100)
uploading: true // 标记为上传中
}
Design Empowers, Innovation Unlimited