vue清空指定属性值的方法:
1.封装:
resetExceptForms(condition,exceptArr) {
if(condition){
for(let [k , v] of Object.entries(condition)){
if(exceptArr&&exceptArr.indexOf(k) === -1) {
condition[k]="";
}
}
}
},
2.使用:
//清空 exceptList表示不需要清除的属性,可自定义
resetQueryFormes() {
let exceptList=["S_Type_EQ"];
this.resetExceptForms(this.condition,exceptList)
},