# 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
上次更新: 8/20/2022, 16:01:00