1.filter和map结合使用
将下拉框中的数据包含企业两个字的那一行数据附为select框的默认值
if (use_t == "企业") {
if (!city) {
} else {
const user_types = ref.dataArray.filter((v: any) => {
return v.manage_unit_name.indexOf(city) != -1
}).map((j: any) => {
return j.manage_unit_no;
});
console.log(user_types)
for (let i = 0; i < manage_unit_name.options.length; i++) {
if (manage_unit_name.options[i].value == user_types[0]) {
manage_unit_name.options[i].selected = true;
}
}
}
}