File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
src/views/mp/material/components Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 7
7
:file-list =" fileList"
8
8
:data =" uploadData"
9
9
:on-progress =" () => (uploading = true)"
10
+ :on-error =" (err: Error) => message.error(`上传失败: ${err.message}`)"
10
11
:before-upload =" beforeUpload"
11
12
:on-success =" handleUploadSuccess"
12
13
>
@@ -33,7 +34,7 @@ import {
33
34
34
35
const message = useMessage ()
35
36
36
- const props = defineProps <{ type: boolean }>()
37
+ const props = defineProps <{ type: MaterialType }>()
37
38
38
39
const fileList = ref <UploadUserFile []>([])
39
40
const emit = defineEmits <{
@@ -47,7 +48,7 @@ const uploadData: UploadData = reactive({
47
48
})
48
49
const uploading = ref (false )
49
50
50
- const beforeUpload = props .type == MaterialType .Image ? beforeImageUpload : beforeVoiceUpload
51
+ const beforeUpload = props .type === MaterialType .Image ? beforeImageUpload : beforeVoiceUpload
51
52
52
53
const handleUploadSuccess: UploadProps [' onSuccess' ] = (res : any ) => {
53
54
if (res .code !== 0 ) {
Original file line number Diff line number Diff line change 9
9
:data =" uploadData"
10
10
:before-upload =" beforeVideoUpload"
11
11
:on-progress =" () => (uploading = true)"
12
+ :on-error =" (err: Error) => message.error(`上传失败: ${err.message}`)"
12
13
:on-success =" handleUploadSuccess"
13
14
ref =" uploadVideoRef"
14
15
:auto-upload =" false"
You can’t perform that action at this time.
0 commit comments