# js 给数组对象增加一项
返回的数据不能满足业务需求,需要增加一项
const factoryRes = http.get("/api/mes/GetMatClassData", param, headers);
factoryRes.then((res) => {
const data = res.data.Data;
data.forEach(item => {
item.key =uuid()
});
setFactoryArr(data);
});
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8