2

1、添加ref

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

2、获取input file

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

3、执行清空操作

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

张旭超
1.4k 声望222 粉丝

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