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

PropertyBasic component module for translation keys shared across all component documentation pagesTypeDefault
imagesArray of image objectsArray[]
allowUploadWhether to allow uploading new imagesBooleanfalse

Events

EventBasic component module for translation keys shared across all component documentation pagesParameters
uploadTriggered when the upload button is clicked or files are dropped, provides array of file and ID objects
fileItems: Array<{file: File, id: String}>
update:imagesTriggered 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