vue-file-agent icon indicating copy to clipboard operation
vue-file-agent copied to clipboard

How to Reset / ReInitialize the Component after form is submitted.

Open jay-p-b-7span opened this issue 2 years ago • 1 comments

Hello, Vue File Agent package is great for dealing with file handling in vue js applications.

I came across this problem of restting form fields after form is submitted. But for Vue File Agent there was no option i found in documentation to Reset / Reinitialize the component. I have attached a demo Form for reference.

Problem

  • After filling out form, all other fields gets reset. except Vue File Agent. Files still seen. image Form filled

My Expectations :

  • We might have an method like reset which can be called using ref from parent. this.$refs.fileAgent.reset()

image

jay-p-b-7span avatar Aug 23 '22 15:08 jay-p-b-7span

just set your v-model to null or []

this.form.files = []

trikarai avatar Aug 25 '22 09:08 trikarai