一般的解决方法:
Html
<input id="file" type="file" onchange="upload()" />
JS
事件逻辑执行完之后执行:
document.getElementById('file').value = null;
Vue中
- <input ref="referenceUpload" @change="referenceUpload" type="file" accept=".map" multiple/>
methods: { referenceUpload(e) { this.$refs.referenceUpload.value = null; }, }