//判断对象是否为空
isEmpty(obj){
for (let key in obj){
return false;
}
return true;
},
然后调用判断
var sampleFiledExcelNull = this.isEmpty(this.addform.sampleFiledExcel);
if (sampleFiledExcelNull) {
layer.msg('请上传导入的文件');
return false;
}
//判断对象是否为空
isEmpty(obj){
for (let key in obj){
return false;
}
return true;
},
然后调用判断
var sampleFiledExcelNull = this.isEmpty(this.addform.sampleFiledExcel);
if (sampleFiledExcelNull) {
layer.msg('请上传导入的文件');
return false;
}