在emelent上传附件onSuccess钩子中写下面判断
//在emelent上传附件onSuccess钩子中写下面判断
//回调
onSuccess: function (response, file, fileList) {
if (response.data) {
if(file.size>5242880){
this.$message({
message: '每个文件不超过5M',
type: 'warning'
});
return false
}
//判断存储的数组长度
if(this.ruleForm.fileAccessorys.length>=10){
this.$message({
message: '附件个数不超10个',
type: 'warning'
})
return false
}
})