若依前后端分离默认跳转到第一个子菜单

网友投稿 2635 2022-10-25

若依前后端分离默认跳转到第一个子菜单

若依前后端分离默认跳转到第一个子菜单

// 菜单选择事件handleSelect(key, keyPath) { this.currentIndex = key; if (this.is{ // 路径新窗口打开 window.open(key, "_blank"); } else if (key.indexOf("/redirect") !== -1) { // /redirect 路径内部打开 this.$router.push({ path: key.replace("/redirect", "") }); } else { // 显示左侧联动菜单 this.activeRoutes(key); let myRoutes = []; if (this.childrenMenus && this.childrenMenus.length > 0) { this.childrenMenus.map((item) => { if (key == item.parentPath || (key == "index" && "" == item.path)) { myRoutes.push(item); } }); } setTimeout(() => { if(myRoutes[0].path != this.$route.path) { this.$router.replace({ path: myRoutes[0].path }) } else { this.$router.replace({ path: '/index' }) } }, 100) }},

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:AnyDSL- 领域特定类库快速开发框架
下一篇:ThinkJS是一款拥抱未来的 Node.js Web 框架
相关文章

 发表评论

暂时没有评论,来抢沙发吧~