-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[comp:upload]新增文件上传组件 #605
Labels
Comments
问题
|
问题:
另外,我建议你再去调研一下我们业务线自己已经封装过的上传组件看看,有没有一些基础场景被遗漏了。 |
review
|
补充需求
|
typistZxd
added a commit
to typistZxd/idux
that referenced
this issue
Dec 27, 2021
13 tasks
typistZxd
added a commit
to typistZxd/idux
that referenced
this issue
Dec 29, 2021
typistZxd
added a commit
to typistZxd/idux
that referenced
this issue
Dec 30, 2021
typistZxd
added a commit
to typistZxd/idux
that referenced
this issue
Dec 31, 2021
typistZxd
added a commit
to typistZxd/idux
that referenced
this issue
Jan 3, 2022
typistZxd
added a commit
to typistZxd/idux
that referenced
this issue
Jan 3, 2022
typistZxd
added a commit
to typistZxd/idux
that referenced
this issue
Jan 3, 2022
typistZxd
added a commit
to typistZxd/idux
that referenced
this issue
Jan 4, 2022
typistZxd
added a commit
to typistZxd/idux
that referenced
this issue
Jan 11, 2022
typistZxd
added a commit
to typistZxd/idux
that referenced
this issue
Jan 14, 2022
typistZxd
added a commit
to typistZxd/idux
that referenced
this issue
Jan 14, 2022
typistZxd
added a commit
to typistZxd/idux
that referenced
this issue
Jan 18, 2022
danranVm
pushed a commit
that referenced
this issue
Jan 18, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What problem does this feature solve?
What does the proposed API look like?
接口设计
API
IxUpload
UploadProps
accept
string
action
string | (file: UploadFile) => Promise<string>
customRequest
(option: UploadRequestOption) => void
data
Record<string, unknown> | ((file: UploadFile) => Record<string, unknown> | Promise<Record<string, unknown>>)
drag
boolean
false
v-model:fileList
UploadFile[]
[]
directory
boolean
false
disabled
boolean
false
headers
object
maxCount
number
method
string
post
multiple
boolean
false
name
string
file
withCredentials
boolean
false
transformFile
(file: File) => string | Blob | File | Promise<string | Blob | File>
onSelect
(file: File | File[]) => boolean | Promise<boolean>
() => true
onChange
file:当前变化的文件对象
fileList:当前文件列表
(file: UploadFile) => void
onBeforeUpload
返回
false
阻止上传返回
Promise
对象reject
时停止上传返回
Promise
对象resolve
时开始上传(file: UploadFile | UploadFile[]) => boolean | Promise<boolean>
() => true
onStart
(file: UploadFile) => void
onProgress
(e: ProgressEvent, file: UploadFile | UploadFile[], xhr: XMLHttpRequest) => void
onCancel
(res: Response, file: UploadFile, xhr: XMLHttpRequest) => void
onEnd
(res: Response, file: UploadFile, xhr: XMLHttpRequest) => void
IxUploadTextList 文本列表展示
UploadTextListProps
fileIcon
string | boolean | VNode
paper-clip
downloadIcon
string | boolean | VNode
false
removeIcon
string | boolean | VNode
close
retryIcon
string | boolean | VNode
reload
onDownload
返回值为 false 时不移除,支持返回一个 Promise 对象,Promise 对象 resolve(false) 或 reject 时不允许下载
(file: UploadFile) => boolean | Promise<boolean>
onPreview
(file: UploadFile) => boolean | Promise<boolean>
onRemove
(file: UploadFile) => boolean | Promise<boolean>
onRetry
(file: UploadFile) => boolean | Promise<boolean>
IxUploadImageList 图片列表展示
UploadImageListProps
thumb
false | ((file: UpLoadFile) => string | false | Promise<string | false>)
previewIcon
string | boolean | VNode
eye
downloadIcon
string | boolean | VNode
false
removeIcon
string | boolean | VNode
close
retryIcon
string | boolean | VNode
reload
onDownload
返回值为 false 时不移除,支持返回一个 Promise 对象,Promise 对象 resolve(false) 或 reject 时不允许下载
(file: UploadFile) => boolean | Promise<boolean>
onPreview
(file: UploadFile) => boolean | Promise<boolean>
onRemove
(file: UploadFile) => boolean | Promise<boolean>
onRetry
(file: UploadFile) => boolean | Promise<boolean>
IxUploadImageCardList 卡片图列表展示
配置卡片图则自带上传按钮
UploadImageCardListProps
thumb
false | ((file: UpLoadFile) => string | false | Promise<string | false>)
previewIcon
string | boolean | VNode
eye
downloadIcon
string | boolean | VNode
false
removeIcon
string | boolean | VNode
close
retryIcon
string | boolean | VNode
reload
onDownload
返回值为 false 时不移除,支持返回一个 Promise 对象,Promise 对象 resolve(false) 或 reject 时不允许下载
(file: UploadFile) => boolean | Promise<boolean>
onDownload
(file: UploadFile) => boolean | Promise<boolean>
onPreview
(file: UploadFile) => boolean | Promise<boolean>
onRemove
(file: UploadFile) => boolean | Promise<boolean>
onRetry
(file: UploadFile) => boolean | Promise<boolean>
IxUploadSlots
default
slotProp
fileList
{fileList: UploadFile[], opr: FileOpr}
tip
The text was updated successfully, but these errors were encountered: