Vue3+ Vite + Element-Plus + TypeScript 从0到1搭建企业级后台管理系统之我想做一个点击详情的跳转页,在菜单里添加后打印解析后的动态路由列表里没有是怎么回事啊?还是说不用在菜单管理配置而是在router的constantRoutes里加配置?但是最后面代码跳转不过去,得加在
path: "/",
name: "/",
component: Layout,
redirect: "/dashboard",
children: [
才行,并且有时路由跳转但是页面没有变化需要刷新才行,并且没有走监听,onmounted,全局路由守卫,或者我需要再写一个动态路由?比如
export const dynamicRoutes = [
{
path: '/system/dict-data',
component: Layout,
hidden: true,
permissions: ['system:dict:list'],
children: [
{
path: 'index/:dictId(\\d+)',
component: () => import('@/views/system/dict/data'),
name: 'Data',
meta: { title: '字典数据', activeMenu: '/system/dict' },
},
],
},

export const constantRoutes: RouteRecordRaw[] = [
{
path: "/login",
component: () => import("@/views/login/index.vue"),
meta: { hidden: true },
},
{
path: "/infoRooms",
name: "RoomInfos",
component: Layout,
redirect: "/infoRoom",
children: [{
path: "infoRoom",
name: "RoomInfo",
component: () => import("@/views/room/room/info.vue"),
meta: { title: "房间管理详情", icon: "user" },
},],
},