两个数组如何匹配合并成
cameraTypeList: [
{ title: "道路沿线", bg: "dlyx-btn", type: "1" },
{ title: "桥梁", bg: "mj-btn", type: "2" },
{ title: "隧道", bg: "qd-btn", type: "3" },
{ title: "ETC门架", bg: "etc-btn", type: "7" },
{ title: "收费站", bg: "sfz-btn", type: "5" },
{ title: "服务区", bg: "fwq-btn", type: "6" },
{ title: "加油站", bg: "online-btn", type: "9" },
{ title: "其它", bg: "qt-btn", type: "4" },
],
cameraClassifyCount:[
{ classify: "1" ,count:"12344"},
{ classify: "2" ,count:"2321"},
{ classify: "3" ,count:"333"},
{ classify: "7" ,count:"123"},
{ classify: "5" ,count:"444"},
{ classify: "6" ,count:"666"},
{ classify: "9" ,count:"111"},
{ classify: "4" ,count:"222"},
],
根据 type = classify 想把 count 数据匹配加到第一个数组里。
cameraTypeList: [
{ title: "道路沿线", bg: "dlyx-btn", type: "1" , count:"12344" },
{ title: "桥梁", bg: "mj-btn", type: "2" , count:"2321" },
{ title: "隧道", bg: "qd-btn", type: "3" , count:"333" },
{ title: "ETC门架", bg: "etc-btn", type: "7" , count:"123" },
{ title: "收费站", bg: "sfz-btn", type: "5" , count:"444" },
{ title: "服务区", bg: "fwq-btn", type: "6" , count:"666" },
{ title: "加油站", bg: "online-btn", type: "9" , count:"111" },
{ title: "其它", bg: "qt-btn", type: "4" , count:"222" },
],
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)