1、增加 ref
<input type="file" ref="uploadFile" />
2、获取 input file
...
setup () {let uploadFile = ref('uploadFile')
return {uploadFile}
3、执行清空操作
setup () {
...
const clearInput = () => {uploadFile.value.value = ''}
...
}
<input type="file" ref="uploadFile" />
...
setup () {let uploadFile = ref('uploadFile')
return {uploadFile}
setup () {
...
const clearInput = () => {uploadFile.value.value = ''}
...
}