mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
* refactor(components): refactor ElUpload * refactor(components): refactor upload * test: use jsx * refactor: resolve review comments * fix: ts error * refactor: re-order imports * refactor: rename * fix: infinity watch * refactor: rename * refactor: address PR comments Co-authored-by: Kevin <sxzz@sxzz.moe>
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, UploadHooks, UploadFiles } 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>
|