原数组:
新数组:
//原数组
let obj = [{
datetime: "2021-09-09 14:56:36",
area: "上海",
detail: "二月二月砚田街h",
image: "",
shareimageurl: "https://jdy-crm.oss-cn- beijing.aliyuncs.com/kd_pro/1536230697407890389/20210831/3008633655172026.jpg",
content: "二月砚田街和er'he'r'h",
channelId: 5031,
modelId: 1421,
modelName: "活动列表模型",
titleColor: "#333333",
titleIsBold: true,
title: "bhrthrt",
type: 5,
shortTitle: "rher"
}]
//改变数组结构 map方法
let arr = obj.map((item)=>{
return {
json: {
datetime: "2021-09-09 14:56:36",
area: "上海",
detail: "二月二月砚田街h",
image: "",
shareimageurl: "https://jdy-crm.oss-cn-beijing.aliyuncs.com/kd_pro/1536230697407890389/20210831/3008633655172026.jpg",
content: "二月砚田街和er'he'r'h"
},
channelId: 5031,
modelId: 1421,
modelName: "活动列表模型",
title: {
titleColor: "#333333",
titleIsBold: true,
title: "bhrthrt"
},
type: 5,
shortTitle: "rher"
}
})
console.log(arr);