数组一:
`[
{
"id": "1",
"mid": "01",
"title": "用户管理",
"submain": ""
},
{
"id": "2",
"mid": "02",
"title": "权限管理",
"submain": ""
}
]`
数组二:
`[
{
"submid": "01",
"ename": "用户列表"
},
{
"submid": "02",
"ename": "权限用户"
},
{
"submid": "02",
"ename": "权限列表"
}
]`
需要合成的数组三:
`[
{
"id": "1",
"mid": "01",
"title": "用户管理",
"submain":
{
"submid": "01",
"ename": "用户列表"
}
},
{
"id": "2",
"mid": "02",
"title": "权限管理",
"submain":
{
"submid": "02",
"ename": "权限用户"
},
{
"submid": "02",
"ename": "权限列表"
}
}
]`
已知数组一和数组二,用Js合成数组三.有没有大佬贴一下代码..蟹蟹