You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

153 lines
4.9 KiB

import Layout from '@/layout'
const Login = () => import('@/views/login')
const Notfound = () => import('@/views/404')
import warning from './warning'
import playground from './playground'
/**
* hidden: true if `hidden:true` will not show in the sidebar(default is false)
* alwaysShow: true if set true, will always show the root menu, whatever its child routes length
* if not set alwaysShow, only more than one route under the children
* it will becomes nested mode, otherwise not show the root menu
* redirect: noredirect if `redirect:noredirect` will no redirct in the breadcrumb
* name:'router-name' the name is used by <keep-alive> (must set!!!)
* meta : {
title: 'title' the name show in submenu and breadcrumb (recommend set)
icon: 'svg-name' the icon show in the sidebar,
}
**/
/**
* hidden: true 如果在模板中使用该选项,则不会在侧栏显示该路由(例如:Dashboard),如果是在第一个子路由中使用,侧栏则只显示第一个子路由的名字和图标(例如: Form)
* alwaysShow: true 如果设置为true它则会始终显示根菜单,无视自路由长度,没有设置的话,就会折叠起来(不清楚为什么没有作用,可能是我写错位置了?)
* redirect: noredirect 若设置为noredirect则顶部面包屑不能够为其重定向.
* onlyShowfirst: false 若该设置为true时,将会无视其有多少个孩子路由,只会显示第一个子路由并将其设置为根菜单
* name:'router-name' 路由名称,此项为必须填写项
* meta : {
title: 'title' 这里的名字决定了面包屑和侧栏的名字
icon: 'svg-name' 当你在svg文件夹内加入了你的图标,那么在这里填写图标名他就会显示在侧栏
}
**/
const routes = [
{ path: '/login', component: Login, hidden: true },
{
path: '/',
component: Layout,
name: 'Welcome',
redirect: '/dashboard',
children: [{
path: '/dashboard',
component: () => import('@/views/dashboard'),
}],
meta: { title: '欢迎页', icon: 'form', noCache: true }
},
{
path: '/menuManage',
component: Layout,
children: [{
path: 'index',
name: 'MenuManage',
component: () => import('@/views/menu'),
meta: { title: '菜单管理', icon: 'tree-table', noCache: true }
}]
},
{ path: '*', component: Notfound, hidden: true },
{
path: '/article',
component: Layout,
name: 'article',
meta: { title: '内容中心', icon: 'form' },
children: [{
path: 'index',
name: 'articleIndex',
component: () => import('@/views/article/index'),
meta: { title: '文章列表', icon: 'form', noCache: true }
}, {
path: 'category',
name: 'articleCategory',
component: () => import('@/views/article/category'),
meta: { title: '文章类别', icon: 'form', noCache: true }
},
{
path: 'subject',
component: () => import('@/views/article/subject/layout'),
name: 'subject',
meta: { title: '专题管理', icon: 'form' },
children: [{
path: 'list',
name: 'subjectIndex',
component: () => import('@/views/article/subject/index'),
meta: { title: '专题列表', icon: 'form', noCache: true }
}, {
path: 'article',
name: 'subjectArticle',
component: () => import('@/views/article/subject/article'),
meta: { title: '专题文章', icon: 'form', noCache: true }
},
]
},
]
},
{
path: '/ad',
component: Layout,
name: 'AD',
meta: { title: '广告中心', icon: 'form' },
children: [{
path: 'index',
name: 'adIndex',
component: () => import('@/views/ad/index'),
meta: { title: '首页管理', icon: 'form', noCache: true }
}
]
},
{
path: '/admin',
component: Layout,
name: 'Admin',
meta: { title: '用户', icon: 'form' },
children: [{
path: 'index',
name: 'AdminIndex',
component: () => import('@/views/admin/index'),
meta: { title: '管理员管理', icon: 'form', noCache: true }
}
]
},
{
path: '/role',
component: Layout,
name: 'Role',
meta: { title: '角色', icon: 'form' },
children: [{
path: 'index',
name: 'RoleIndex',
component: () => import('@/views/role/index'),
meta: { title: '角色管理', icon: 'form', noCache: true }
}
]
},
...warning,
// ...games,
{
path: '/updateVersion',
component: Layout,
children: [{
path: 'index',
name: 'UpdateVersion',
component: () => import('@/views/updateVersion/updateVersion'),
meta: { title: '版本更新', icon: 'form', noCache: true }
}]
},
...playground,
]
export default routes