pure-admin / vue-pure-admin

全面ESM+Vue3+Vite+Element-Plus+TypeScript编写的一款后台管理系统(兼容移动端)
https://pure-admin.github.io/vue-pure-admin
MIT License
15.71k stars 2.97k forks source link

动态目录切换bug #715

Closed JennShiting closed 1 year ago

JennShiting commented 1 year ago

描述问题 (Describe the problem)

动态目录增加到三级,出现切页bug。页面显示空白。 具体目录配置: // 模拟后端动态生成路由 import { MockMethod } from "vite-plugin-mock";

/**

const permissionRouter = { path: "/permission", meta: { title: "权限管理", icon: "lollipop", rank: 10 }, children: [ { path: "/permission/page/index", name: "PermissionPage", meta: { title: "页面权限", roles: ["admin", "common"] } }, { path: "/permission/button/index", name: "PermissionButton", meta: { title: "按钮权限", roles: ["admin", "common"], auths: ["btn_add", "btn_edit", "btn_delete"] } } ] };

// 动态配置四季模块 const sijiRouter = { path: "/siji", meta: { title: "四季", icon: "iconoir:3d-three-pts-box", rank: 20, roles: ["admin", "common"] }, children: [ { path: "/siji/chun", meta: { title: "春天" }, children: [ { path: "/siji/chun/yiyue/index", name: "yue-1", meta: { title: "一月" } }, { path: "/siji/chun/eryue/index", name: "yue-2", meta: { title: "二月" } }, { path: "/siji/chun/sanyue/index", name: "yue-3", meta: { title: "三月" } } ] }, { path: "/siji/xia", meta: { title: "夏天", roles: ["admin", "common"] }, children: [ { path: "/siji/xia/siyue/index", name: "yue-4", meta: { title: "四月" } }, { path: "/siji/xia/wuyue/index", name: "yue-5", meta: { title: "五月" } }, { path: "/siji/xia/liuyue/index", name: "yue-6", meta: { title: "六月" } } ] }, { path: "/siji/qiu", meta: { title: "秋天" }, children: [ { path: "/siji/qiu/qiyue/index", name: "yue-7", meta: { title: "七月" } }, { path: "/siji/qiu/bayue/index", name: "yue-8", meta: { title: "八月" } }, { path: "/siji/qiu/jiuyue/index", name: "yue-9", meta: { title: "九月" } } ] }, { path: "/siji/dong", meta: { title: "冬天" }, children: [ { path: "/siji/dong/shiyue/index", name: "yue-10", meta: { title: "十月" } }, { path: "/siji/dong/shiyiyue/index", name: "yue-11", meta: { title: "十一月" } }, { path: "/siji/dong/shieryue/index", name: "yue-12", meta: { title: "十二月" } } ] } ] };

export default [ { url: "/getAsyncRoutes", method: "get", response: () => { return { success: true, data: [sijiRouter] }; } } ] as MockMethod[];

如何复现该问题 (How to reproduce the problem)

有录屏,不知道怎么上传。

操作系统和浏览器信息 (Operating system and browser information)

No response

验证 (Verify)

xiaoxian521 commented 1 year ago

平台有很多demo 多参考 作者很忙 自行研究