Skip to content

Commit

Permalink
feat: 上传组件增加自定义上传
Browse files Browse the repository at this point in the history
  • Loading branch information
hooray committed Jul 9, 2024
1 parent 7457fcc commit 66c0e4f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/FileUpload/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const props = withDefaults(
files?: UploadUserFile[]
notip?: boolean
ext?: string[]
httpRequest?: UploadProps['httpRequest']
}>(),
{
name: 'file',
Expand Down Expand Up @@ -68,6 +69,7 @@ const onSuccess: UploadProps['onSuccess'] = (res, file, fileList) => {
:before-upload="beforeUpload"
:on-exceed="onExceed"
:on-success="onSuccess"
:http-request="httpRequest"
:file-list="files"
:limit="max"
drag
Expand Down
2 changes: 2 additions & 0 deletions src/components/ImageUpload/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const props = withDefaults(
placeholder?: string
notip?: boolean
ext?: string[]
httpRequest?: UploadProps['httpRequest']
}>(),
{
name: 'file',
Expand Down Expand Up @@ -97,6 +98,7 @@ const onSuccess: UploadProps['onSuccess'] = (res) => {
:before-upload="beforeUpload"
:on-progress="onProgress"
:on-success="onSuccess"
:http-request="httpRequest"
drag
class="image-upload"
>
Expand Down
2 changes: 2 additions & 0 deletions src/components/ImagesUpload/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const props = withDefaults(
placeholder?: string
notip?: boolean
ext?: string[]
httpRequest?: UploadProps['httpRequest']
}>(),
{
name: 'file',
Expand Down Expand Up @@ -131,6 +132,7 @@ const onSuccess: UploadProps['onSuccess'] = (res) => {
:before-upload="beforeUpload"
:on-progress="onProgress"
:on-success="onSuccess"
:http-request="httpRequest"
drag
class="images-upload"
>
Expand Down

0 comments on commit 66c0e4f

Please sign in to comment.