EdwardZZZ / articles

工作点滴记录
2 stars 0 forks source link

遍历tree加前缀 #16

Open EdwardZZZ opened 7 years ago

EdwardZZZ commented 7 years ago
menus.forEach(function foreach(...props) {
  let {id, name, children} = props[0];

  if(id != self.menu.id){
      name = this + name;
      _parentMenuList.push({id, name});

      children && children.length > 0 && children.forEach(foreach.bind(name + '--'));
  }
}.bind(''));