1.过滤对象中haveRight == 1的数据

const map = {}
for (const key in data.idsBtn) {
if (Object.prototype.hasOwnProperty.call(data.idsBtn, key)) {
const element = data.idsBtn[key]
if (element.haveRight == 1) {
map[key] = element
}
}
}
2.数组中过滤相同groupName的数据变成一个数组

效果:

网友评论