删除
删除数组中key等于typeface的对象
let typeface
if (val === 'specificitemCode'){
typeface = "编目号"
}else {
typeface = "编目名称"
}
const index = this.filterList.findIndex(item => item.label === typeface);
if (index !== -1) {
this.filterList.splice(index, 1);
}
修改和新增
const index = this.filterList.findIndex(item => item.label === "编目号");
if (index !== -1) {
//修改
this.filterList[index].value = `${this.specificitemCode}`;
} else {//新增
this.filterList.push({label: "编目号", value: `${this.specificitemCode}`});
}