mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
34 lines
979 B
TypeScript
34 lines
979 B
TypeScript
import { NOOP } from '@vue/shared'
|
|
import { buildProps, definePropType, mutable } from '@element-plus/utils'
|
|
import { uploadListTypes } from './upload'
|
|
import type { ExtractPropTypes } from 'vue'
|
|
import type { UploadFile, UploadFiles, UploadHooks } from './upload'
|
|
import type UploadList from './upload-list.vue'
|
|
|
|
export const uploadListProps = buildProps({
|
|
files: {
|
|
type: definePropType<UploadFiles>(Array),
|
|
default: () => mutable([]),
|
|
},
|
|
disabled: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
handlePreview: {
|
|
type: definePropType<UploadHooks['onPreview']>(Function),
|
|
default: NOOP,
|
|
},
|
|
listType: {
|
|
type: String,
|
|
values: uploadListTypes,
|
|
default: 'text',
|
|
},
|
|
} as const)
|
|
|
|
export type UploadListProps = ExtractPropTypes<typeof uploadListProps>
|
|
export const uploadListEmits = {
|
|
remove: (file: UploadFile) => !!file,
|
|
}
|
|
export type UploadListEmits = typeof uploadListEmits
|
|
export type UploadListInstance = InstanceType<typeof UploadList>
|