map

作者: 执着于98斤的it女 | 来源:发表于2023-08-14 15:33 被阅读0次

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


image.png

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的数据变成一个数组


f3ab470d6af8afce54b8f0aa5749693.png

效果:


d9d7361fa7f8563460cf5b119ac7a9c.png

相关文章

网友评论

      本文标题:map

      本文链接:https://www.haomeiwen.com/subject/vplcmdtx.html