fix: 静态路由菜单国际化/切换刷新

This commit is contained in:
TsMask
2023-11-11 11:44:21 +08:00
parent 1c82719af0
commit 3ae8a7c237
6 changed files with 48 additions and 12 deletions

View File

@@ -28,21 +28,20 @@ const constantRoutes: RouteRecordRaw[] = [
{
path: '/',
name: 'Root',
meta: { title: '根节点' },
component: BasicLayout,
redirect: '/index',
children: [
{
path: '/index',
name: 'Index',
meta: { title: '首页', icon: 'icon-pcduan' },
meta: { title: 'router.index', icon: 'icon-pcduan' },
component: () => import('@/views/index.vue'),
},
{
path: '/account',
name: 'Account',
meta: {
title: '个人中心',
title: 'router.account.index',
hideInMenu: true,
},
component: BlankLayout,
@@ -51,13 +50,13 @@ const constantRoutes: RouteRecordRaw[] = [
{
path: 'profile',
name: 'Profile',
meta: { title: '个人信息', cache: true },
meta: { title: 'router.account.profile', cache: true },
component: () => import('@/views/account/profile.vue'),
},
{
path: 'settings',
name: 'Settings',
meta: { title: '个人设置', cache: true },
meta: { title: 'router.account.settings', cache: true },
component: () => import('@/views/account/settings.vue'),
},
],
@@ -67,25 +66,21 @@ const constantRoutes: RouteRecordRaw[] = [
{
path: '/login',
name: 'Login',
meta: { title: '登录' },
component: () => import('@/views/login.vue'),
},
{
path: '/register',
name: 'Register',
meta: { title: '注册' },
component: () => import('@/views/register.vue'),
},
{
path: '/403',
name: 'NotPermission',
meta: { title: '没有访问权限' },
component: () => import('@/views/error/403.vue'),
},
{
path: '/redirect',
name: 'Redirect',
meta: { title: '重定向' },
component: BasicLayout,
children: [
{
@@ -96,7 +91,6 @@ const constantRoutes: RouteRecordRaw[] = [
},
{
path: '/:pathMatch(.*)*',
meta: { title: '找不到匹配页面' },
component: () => import('@/views/error/404.vue'),
},
];