<el-upload ref="upload" multiple name="File" :action="apis.manageModel" :auto-upload="false" :http-request="httpRequest" :on-change="beforeAvatarUpload" :file-list="newData.fileList" > <el-button size="small" type="primary">点击上传</el-button> <span slot="tip" class="el-upload__tip"> 只能上传dll/xml文件</span> </el-upload> beforeAvatarUpload(file) { let fileName = file.name.substring(file.name.lastIndexOf(".") + 1); const isDLL = fileName === "dll"; const isDLL1 = fileName === "DLL"; const isXML = fileName === "xml"; const isXML1 = fileName === "XML"; if (!isDLL &&!isDLL1 &&!isXML &&!isXML1 ) { this.$message.error( "请上传.dll、.DLL、.xml、.XML类型文件" ); } return ( isDLL ||isDLL1 ||isXML ||isXML1 ); },
到此这篇ElementUI 限制上传文件格式为dll .DLL .xml .XML的文章就介绍到这了,更多相关内容请继续浏览下面的相关推荐文章,希望大家都能在编程的领域有一番成就!
版权声明:
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若内容造成侵权、违法违规、事实不符,请将相关资料发送至xkadmin@xkablog.com进行投诉反馈,一经查实,立即处理!
转载请注明出处,原文链接:https://www.xkablog.com/haskellbc/11288.html