递归子项新增某个属性
文章目录
const ass = (data) => {
data.map((list, i) => {
list.alwaysShow = true
if (list.children && list.children != null) {
ass(list.children)
}
})
return data
}const ass = (data) => {
data.map((list, i) => {
list.alwaysShow = true
if (list.children && list.children != null) {
ass(list.children)
}
})
return data
}
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论