js 的forEach不支持continue解决


break----用return false;

continue --用return true; 

代码如下:

Object.keys(flatMenuData).forEach((key) => {

if (item.routeName === this.$route.name && !rs.activeItem) {

//如果开启了首页不展示左侧菜单,则屏蔽左侧菜单

      if(this.inner_sideMenu.opt.notActiveIndex){

           if(this.$route.name =='index'){

                   return true

             }

        }

    }

}

猜你喜欢

转载自blog.csdn.net/CarryBest/article/details/89000582
今日推荐