export type AffixType = 'camera' | 'gallery' | 'file'; export interface AffixProps { /** * 附件列表 * @type { File[] } * @default undefined * @description 附件列表,包含附件、音频等,可根据file.type区分 */ value?: File[]; /** * 附件类型 * @type { AffixType[] | boolean } * @default true */ affix?: AffixType[] | boolean; /** * 附件容器 * @type { HTMLElement | string } * @default undefined * @description 附件容器,用于指定附件列表的渲染位置。可以是 DOM 元素、CSS 选择器字符串,或为空时渲染在父元素中 */ affixContainer?: HTMLElement | string; /** * 文件预览容器 * @type { HTMLElement | string } * @default undefined * @description 文件预览容器,用于指定文件预览列表的渲染位置。可以是 DOM 元素、CSS 选择器字符串,或为空时渲染在父元素中 */ previewContainer?: HTMLElement | string; /** * 文件变化回调 * @description 文件变化回调,返回附件列表 * @param { File[] } files 附件列表 * @returns { void } */ onChange?: (files: File[]) => void; /** * 文件预览回调 * @description 点击非图片文件时触发,可用于调起系统查看文件页面 * @param { File } file 文件对象 * @returns { void } */ onFilePreview?: (file: File) => void; }