1.在src\router\routes\modules下创建一个article.ts
import type { AppRouteModule } from '/@/router/types';
import { LAYOUT } from '/@/router/constant';
import { t } from '/@/hooks/web/useI18n';
export const article: AppRouteModule = {
path: '/article',
name: 'Article',
component: LAYOUT,
redirect: '/article/detail',
meta: {
orderNo: 10,
icon: 'ion:grid-outline',
title: t('routes.article.detail'),
},
children: [
{
path: 'detail/:id',
name: 'Detail',
component: () =>
import('/@/views/web/knowledge/manage/knowledgeRetrieval/component/detailsPage.vue'),
meta: {
title: t('routes.article.detail'),
},
},
],
};
2.src\store\modules\permission.ts的文件里引入
import { article } from '/@/router/routes/modules/article';
3.添加标签名字,如图
在src\locales\lang\zh_CN\routes下创建article.ts
export default {
detail: '详情页',
};
最后在src\router\routes\modules\article.ts使用即可