正常的写法是这样的
if (newValue == 2) {
this.is_abnormal = true;
} else {
if (this.form.motor != 2 && this.form.die != 2 && this.form.position != 2) {
this.is_abnormal = false;
}
}
使用return和&&符号之后
if (newValue == 2) {
this.is_abnormal = true;
return;// return后下面的代码不执行
}
// 判定&&前面为true时则执行&&后面的代码
(this.form.motor != 2 && this.form.die != 2 && this.form.position != 2)
&& (this.is_abnormal = false);