File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change 2020
2121import { ref , watch } from ' vue'
2222import { ElMessage } from ' element-plus'
23- import { useUserStore } from ' @/pinia/modules/user'
2423import { getBaseUrl } from ' @/utils/format'
2524
2625defineOptions ({
@@ -42,14 +41,11 @@ const props = defineProps({
4241 },
4342})
4443
45- const path = ref (import .meta.env.VITE_BASE_API)
46-
47- const userStore = useUserStore ()
4844const fullscreenLoading = ref (false )
4945
5046const fileList = ref (props .modelValue )
5147
52- const emits = defineEmits ([' update:modelValue' ])
48+ const emits = defineEmits ([' update:modelValue' , ' on-success ' , ' on-error ' ])
5349
5450watch (fileList .value , (val ) => {
5551 console .log (val)
@@ -72,14 +68,16 @@ const uploadSuccess = (res) => {
7268 })
7369 fullscreenLoading .value = false
7470 }
71+ emits (' on-success' , res)
7572}
7673
77- const uploadError = () => {
74+ const uploadError = (err ) => {
7875 ElMessage ({
7976 type: ' error' ,
8077 message: ' 上传失败'
8178 })
8279 fullscreenLoading .value = false
80+ emits (' on-error' ,err)
8381}
8482
8583 </script >
Original file line number Diff line number Diff line change @@ -25,7 +25,6 @@ defineOptions({
2525})
2626
2727const emit = defineEmits ([' on-success' ])
28- const path = ref (import .meta.env.VITE_BASE_API)
2928
3029const fullscreenLoading = ref (false )
3130
You can’t perform that action at this time.
0 commit comments