解决所属领域添加出现undefined问题

This commit is contained in:
熊丽君
2022-02-09 14:59:43 +08:00
parent 0e4d44fa76
commit e3136072a0

View File

@ -53,7 +53,7 @@
v-for="item in levelIII"
:key="item.id"
:label="item.name"
:value="item.id"
:value="item"
>
</el-option>
</el-select>
@ -124,7 +124,24 @@ export default {
_value.push(item.value);
}
newVal.industrys = _key;
this.industrysTags = _value;
let keyObj = [];
for (let i = 0; i < _key.length; i++) {
keyObj.push([]);
let array = _key[i].split("-");
for (let j = 0; j < array.length; j++) {
keyObj[i].push({
id: array[j],
});
}
}
for (let i = 0; i < _value.length; i++) {
let array = _value[i].split(">");
for (let j = 0; j < array.length; j++) {
keyObj[i][j]["name"] = array[j];
}
}
this.industrysTags = keyObj;
},
},
methods: {