当前位置:网站首页 > Haskell函数式编程 > 正文

ElementUI 限制上传文件格式为dll .DLL .xml .XML

<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">&nbsp;&nbsp;&nbsp;只能上传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的文章就介绍到这了,更多相关内容请继续浏览下面的相关推荐文章,希望大家都能在编程的领域有一番成就!

版权声明


相关文章:

  • ElementUI dialog弹出层样式优化2024-11-29 18:18:07
  • ElementUI统一修改滚动条样式2024-11-29 18:18:07
  • Vue-Axios请求传参格式2024-11-29 18:18:07
  • 在子组件中动态给父组件添加样式2024-11-29 18:18:07
  • vscode格式化校验配置2024-11-29 18:18:07
  • 箭头函数改变定时器中的this指向2024-11-29 18:18:07
  • 485报文解析公式(485报文怎么抓取)2024-11-29 18:18:07
  • icmp报文格式ping请求(icmp报文格式分析)2024-11-29 18:18:07
  • lead函数用法(lead lag函数)2024-11-29 18:18:07
  • max函数调用(如何调用max函数)2024-11-29 18:18:07
  • 全屏图片