vue递归获取拥有子集的路由name

2022-11-17  本文已影响0人  Hasan_hs
let names = [];
let newLists = this.menuData("你的路由list",names);

menuData(data,names){
      data.forEach((router=> {
        if (router.children && router.children.length) {
          names.push(router.name);
          this.menuData(router.children, names);
        }
      }));
      return names;
    },


上一篇下一篇

猜你喜欢

热点阅读