Level 7
My bad, I used computed instead of methods.
Hi,
I am trying to move already tested file upload input field as single file Vue component. I have tested this script already and working fine while used on global scope but when the code is moved to component, I am getting the error.
computed: {
myMethog: function(event) {
var input = event.target;
if(input.files && input.files[0]) {
// do something here
}
}
}
Renderer is throwing this error
[Vue warn]: Error in render: "TypeError: Cannot read property 'files' of undefined"
why?
Same code works when it is not inside component.
Please or to participate in this conversation.