将一个普通数组映射为对象数组
将一个普通数组映射为对象数组
this.fileList = this.attachmentList.map(item=>{
return {id:item.id,name:item.fileName,url:item.filePath}
});
不能写成:
this.fileList = this.attachmentList.map(item=>{
id:item.id,name:item.fileName,
url:item.filePath
});
青春承载希望,奋斗成就未来

浙公网安备 33010602011771号