normal code (no if):
//
issue:function(){
this.result = [];
for(var i=0;i<this.formData.length;iPP){
let obj = {
questionUid:this.formData[i].questionUid, //id
questionType:this.formData[i].questionType, //1:23
//
userBlanksDetail:{
answer:this.formData[i].fill
},
//
userOptionDetail:{
optionUid:this.formData[i].single?this.formData[i].single:this.formData[i].mul.join(",")
}
}
this.result.push(obj);
}
this.submit(); //
},
if you add if, you will report an error:
//
issue:function(){
this.result = [];
for(var i=0;i<this.formData.length;iPP){
let obj = {
questionUid:this.formData[i].questionUid, //id
questionType:this.formData[i].questionType, //1:23
//if
if(this.formData[i].questionType == 3){
userBlanksDetail:{
answer:this.formData[i].fill
},
}
//
userOptionDetail:{
optionUid:this.formData[i].single?this.formData[i].single:this.formData[i].mul.join(",")
}
}
this.result.push(obj);
}
this.submit(); //
},
what kind of strange phenomenon is this?