js.map处理数组,新加key

57 阅读1分钟

js.map处理数组,添加新的字段

微信图片_20230413152607.png

that.actions.map(val=>{
    val.name = val.label;//name为新增的key
})