递归子项新增某个属性

const ass = (data) => {
  data.map((list, i) => {
    list.alwaysShow = true
    if (list.children && list.children != null) {
      ass(list.children)
    }
  })
  return data
}

评论

暂无评论