You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have problem with remove function.
Version: "vue-upload-component": "^2.8.22",
I copied remove function form example: https://github.com/lian-yue/vue-upload-component/blob/master/docs/views/examples/Full.vue
And I'm listing files like in example and tried to use remove like in example, but it produce error: Cannot read properties of undefined (reading 'name').
I tried to pass just file.name, but same problem. File contain name and all file data when I tried to log it. clear function works correctly, but I need to remove selected file.
EDIT:
Basically I find out the remove function inside /node_modules/vue-upload-component/dist/vue-upload-component.part.js The line 1332
if(this.emitFilter(undefined,file)){returnfalse;}
Without this piece of code everything work correctly. But I don't know If I can just remove this or maybe this is important part of the code for some other elements?
So for now I made in my component function like:
removeFile(item){constupl=this.$refs.uploadconstfile=upl.get(item)if(file){/* the piece which made the error if (upl.emitFilter(undefined, file)) { return false; }*/constfiles=upl.files.concat([]);constindex=files.indexOf(file);if(index===-1){console.error('remove',file);returnfalse;}files.splice(index,1);upl.files=files;// 定位deleteupl.maps[file.id];// 事件upl.emitInput();upl.emitFile(undefined,file);}},
The text was updated successfully, but these errors were encountered:
Actually I tried without prevent, and the issue is still there.
And I'm not sure how inputFilter has anything to do with it but I treid to add your condition to my code, and there is still the very same exact error that I described.
Hi,
I have problem with remove function.
Version:
"vue-upload-component": "^2.8.22",
I copied remove function form example: https://github.com/lian-yue/vue-upload-component/blob/master/docs/views/examples/Full.vue
And I'm listing files like in example and tried to use remove like in example, but it produce error:
Cannot read properties of undefined (reading 'name')
.I tried to pass just file.name, but same problem. File contain name and all file data when I tried to log it.
clear
function works correctly, but I need to remove selected file.My component setup:
EDIT:
Basically I find out the
remove
function inside/node_modules/vue-upload-component/dist/vue-upload-component.part.js
The line1332
Without this piece of code everything work correctly. But I don't know If I can just remove this or maybe this is important part of the code for some other elements?
So for now I made in my component function like:
The text was updated successfully, but these errors were encountered: