调整资讯相关router

This commit is contained in:
zhl 2021-03-22 14:57:14 +08:00
parent 27634272ae
commit e2a5a2e1be
3 changed files with 49 additions and 42 deletions

View File

@ -65,7 +65,7 @@ export default {
i18n: '国际化', i18n: '国际化',
externalLink: '外链', externalLink: '外链',
profile: '个人中心', profile: '个人中心',
article: '文章管理' article: '资讯管理'
}, },
navbar: { navbar: {
logOut: '退出登录', logOut: '退出登录',

View File

@ -7,6 +7,7 @@ import Layout from '@/layout/index.vue'
/* Router modules */ /* Router modules */
import tableRouter from './modules/table' import tableRouter from './modules/table'
import systemRoutes from '@/router/modules/system' import systemRoutes from '@/router/modules/system'
import articleRouters from '@/router/modules/articlue'
Vue.use(VueRouter) Vue.use(VueRouter)
@ -114,47 +115,7 @@ export const constantRoutes: RouteConfig[] = [
*/ */
export const asyncRoutes: RouteConfig[] = [ export const asyncRoutes: RouteConfig[] = [
systemRoutes, systemRoutes,
{ articleRouters,
path: '/article',
component: Layout,
redirect: '/article/list',
meta: {
title: 'article',
icon: 'list',
alwaysShow: true
},
children: [
{
path: 'create',
component: () => import(/* webpackChunkName: "example-create" */ '@/views/article/create.vue'),
name: 'CreateArticle',
meta: {
title: 'createArticle',
icon: 'edit'
}
},
{
path: 'edit/:id(\\d+)',
component: () => import(/* webpackChunkName: "example-edit" */ '@/views/article/edit.vue'),
name: 'EditArticle',
meta: {
title: 'editArticle',
noCache: true,
activeMenu: '/article/list',
hidden: true
}
},
{
path: 'list',
component: () => import(/* webpackChunkName: "example-list" */ '@/views/article/list.vue'),
name: 'ArticleList',
meta: {
title: 'articleList',
icon: 'list'
}
}
]
},
{ {
path: '/error-log', path: '/error-log',
component: Layout, component: Layout,

View File

@ -0,0 +1,46 @@
import { RouteConfig } from 'vue-router'
import Layout from '@/layout/index.vue'
const articleRouters: RouteConfig = {
path: '/article',
component: Layout,
redirect: '/article/list',
meta: {
title: 'article',
icon: 'list',
alwaysShow: true
},
children: [
{
path: 'create',
component: () => import(/* webpackChunkName: "example-create" */ '@/views/article/create.vue'),
name: 'CreateArticle',
meta: {
title: 'createArticle',
icon: 'edit'
}
},
{
path: 'edit/:id(\\d+)',
component: () => import(/* webpackChunkName: "example-edit" */ '@/views/article/edit.vue'),
name: 'EditArticle',
meta: {
title: 'editArticle',
noCache: true,
activeMenu: '/article/list',
hidden: true
}
},
{
path: 'list',
component: () => import(/* webpackChunkName: "example-list" */ '@/views/article/list.vue'),
name: 'ArticleList',
meta: {
title: 'articleList',
icon: 'list'
}
}
]
}
export default articleRouters