赞
踩
<el-upload
ref="uploadref"
:limit="1"
:action="url"
:on-change="handleChang"
:on-exceed="handleExceed"
:auto-upload="false"
:on-success="ywzgdw_data"
>
<el-button slot="trigger" size="small" type="danger">上传</el-button>
</el-upload>
handleChang(file, fileList, index){
// 检测文件类型不符合时终止显示文件列表
if(file.type != 'application/pdf'){
this.$message.error('只能上传 pdf 文件')
console.log(this.$refs.uploadref)
this.$refs.uploadref.uploadFiles=[];
return false;
}
}
参考:https://blog.csdn.net/m0_60908822/article/details/122079494
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。