2

1. Add ref

<input type="file" ref="uploadFile" />

2. Get the input file

...
setup () {
let uploadFile = ref('uploadFile')
return {
  uploadFile
}

3. Perform the emptying operation

setup () {
...
  const clearInput = () => {
    uploadFile.value.value = ''
  }
...
}

张旭超
1.4k 声望222 粉丝

精通 html+div+css jquery, vue, angularjs, angular2, angular4, ionic, ionic2