title: How to reset file input with VueJS
slug: how-to-reset-file-input-with-vuejs
status: published
date: 2018/02/04 06:05:15


It took me a while of digging to find how to do this.

Turns out that you have to resort to using your component's `$refs` and then you have access to your HTML object.

In your template:

<pre>&lt;input type="file" ref="myFileInput"/&gt;</pre>

In your component's method:

<pre>this.$refs.myFileInput.value = '';</pre>
