递归过滤树结构数据
export function getCurrentMenu(dataList, roleList){ let menu = dataList.filter(item =>{ console.log(roleList.indexOf(item.name) !== -1) if(roleList.indexOf(item.name) !== -1){ if(item.children){ //递归循环 item.children=getCurrentMenu(item.children,roleList) } return item } }) return menu }