let nape = []; for (let i = 0; i < list.length; i++) { let res = JSON.parse( JSON.stringify(list[i]) .replace(/id/g, 'itemId') .replace(/desc/g, 'itemName') ); nape.push(res); } console.log(nape)
修改前
修改后
标签:vue,res,JSON,replace,nape,let,数组,属性 From: https://www.cnblogs.com/Ao-min/p/16597531.html