2.5.16
The file you uploaded still exists, and it shows the file name.
It shows "No file chosen."
I know this is a multiple post, and it is not a good practice, but I would like to know how to fix this issue.
You used a v-if in the file with a condition that will be false after ou click test 2. Consequently, Vue will remove the file input from the DOM, and the file disappears.
You can use v-show instead.
Thank you very much! I replaced v-if with v-show, and it resolved my issue!
I spent hours to try to figure it out, and finally it works as I wished. I learned the difference between v-if and v-show, and actually, it is mentioned in the Guide:
https://vuejs.org/v2/guide/conditional.html#v-if-vs-v-show
Thank you! I learned a lot!
I had similar issue while usingv-ifto step through different part of a form. when "Next" is clicked, i increment the step variable so that a different part shows and and a "back" button decrements the step variable to show the previous page just like a "stepwizard". Then i noticed that all the uploaded files disappears from DOM but was still available in my local file variable in the data section when back is clicked
I guess I have to take time and go through vuejs documentation so that i don't miss vital details that will save me some trouble. #lesson learned
Most helpful comment
Thank you very much! I replaced
v-ifwithv-show, and it resolved my issue!I spent hours to try to figure it out, and finally it works as I wished. I learned the difference between
v-ifandv-show, and actually, it is mentioned in the Guide:https://vuejs.org/v2/guide/conditional.html#v-if-vs-v-show
Thank you! I learned a lot!