vue 清空input标签 中file的值操作
template中:
methods中:
onUpload(){ this.$refs.pathClear.value='' },
补充知识:将inputfile的选择的文件清空的两种解决方案
上传文件时,选择了文件后想清空文件路径,搜索了一下,用两种方法解决
第一种
varobj=document.getElementById(‘fileupload'); obj.select(); document.selection.clear();
第二种
varobj=document.getElementById(‘fileupload');
obj.outerHTML=obj.outerHTML;
以上这篇vue清空input标签中file的值操作就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持毛票票。