laiyidiedanchaofenba

Results 4 comments of laiyidiedanchaofenba

这是测试动态路由使用的mock模拟数据,parentId 是父菜单id,id是子菜单id,可以根据这个格式从后台返回菜单

想刷新整个页面的话是location.reload(),想刷新 主界面的话是在APP.vue 里 `` `provide() { return { reload:this.reload } }, data () { return { locale: zhCN, isRouterAlice:true } },` `reload() { this.isRouterAlice =false this.$nextTick(function() { this.isRouterAlice =true })...

![11111](https://user-images.githubusercontent.com/46549742/154029164-3eb9d826-581b-4782-9033-cb8925a27b3a.png) ![22222](https://user-images.githubusercontent.com/46549742/154029178-9bf2711e-7a7d-46ea-89ae-47f8dbf57a31.png) ![33333](https://user-images.githubusercontent.com/46549742/154029187-a9b9c084-646c-4b9b-bf91-6cc7a55eafbc.png)

感谢,通过@sendya的提醒,我反复研究了一下generator-routers.js, 在generator()中打印了一下:console.log(item.component,constantRouterComponents[item.component]),发现constantRouterComponents['BasicLayout']居然是undefined,于是我把constantRouterComponents中的BasicLayout改成了() => import('@/layouts/BasicLayout'),菜单总算出来了! ![44444](https://user-images.githubusercontent.com/46549742/154037918-994af78c-f3b0-461f-a518-682bbe662d95.png)