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.

152 lines
4.9 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. import Layout from '@/layout'
  2. const Login = () => import('@/views/login')
  3. const Notfound = () => import('@/views/404')
  4. import warning from './warning'
  5. import playground from './playground'
  6. /**
  7. * hidden: true if `hidden:true` will not show in the sidebar(default is false)
  8. * alwaysShow: true if set true, will always show the root menu, whatever its child routes length
  9. * if not set alwaysShow, only more than one route under the children
  10. * it will becomes nested mode, otherwise not show the root menu
  11. * redirect: noredirect if `redirect:noredirect` will no redirct in the breadcrumb
  12. * name:'router-name' the name is used by <keep-alive> (must set!!!)
  13. * meta : {
  14. title: 'title' the name show in submenu and breadcrumb (recommend set)
  15. icon: 'svg-name' the icon show in the sidebar,
  16. }
  17. **/
  18. /**
  19. * hidden: true 如果在模板中使用该选项,则不会在侧栏显示该路由(例如Dashboard),如果是在第一个子路由中使用,侧栏则只显示第一个子路由的名字和图标(例如: Form)
  20. * alwaysShow: true 如果设置为true它则会始终显示根菜单,无视自路由长度,没有设置的话,就会折叠起来(不清楚为什么没有作用,可能是我写错位置了?)
  21. * redirect: noredirect 若设置为noredirect则顶部面包屑不能够为其重定向.
  22. * onlyShowfirst: false 若该设置为true时将会无视其有多少个孩子路由只会显示第一个子路由并将其设置为根菜单
  23. * name:'router-name' 路由名称,此项为必须填写项
  24. * meta : {
  25. title: 'title' 这里的名字决定了面包屑和侧栏的名字
  26. icon: 'svg-name' 当你在svg文件夹内加入了你的图标,那么在这里填写图标名他就会显示在侧栏
  27. }
  28. **/
  29. const routes = [
  30. { path: '/login', component: Login, hidden: true },
  31. {
  32. path: '/',
  33. component: Layout,
  34. name: 'Welcome',
  35. redirect: '/dashboard',
  36. children: [{
  37. path: '/dashboard',
  38. component: () => import('@/views/dashboard'),
  39. }],
  40. meta: { title: '欢迎页', icon: 'form', noCache: true }
  41. },
  42. {
  43. path: '/menuManage',
  44. component: Layout,
  45. children: [{
  46. path: 'index',
  47. name: 'MenuManage',
  48. component: () => import('@/views/menu'),
  49. meta: { title: '菜单管理', icon: 'tree-table', noCache: true }
  50. }]
  51. },
  52. { path: '*', component: Notfound, hidden: true },
  53. {
  54. path: '/article',
  55. component: Layout,
  56. name: 'article',
  57. meta: { title: '内容中心', icon: 'form' },
  58. children: [{
  59. path: 'index',
  60. name: 'articleIndex',
  61. component: () => import('@/views/article/index'),
  62. meta: { title: '文章列表', icon: 'form', noCache: true }
  63. }, {
  64. path: 'category',
  65. name: 'articleCategory',
  66. component: () => import('@/views/article/category'),
  67. meta: { title: '文章类别', icon: 'form', noCache: true }
  68. },
  69. {
  70. path: 'subject',
  71. component: () => import('@/views/article/subject/layout'),
  72. name: 'subject',
  73. meta: { title: '专题管理', icon: 'form' },
  74. children: [{
  75. path: 'list',
  76. name: 'subjectIndex',
  77. component: () => import('@/views/article/subject/index'),
  78. meta: { title: '专题列表', icon: 'form', noCache: true }
  79. }, {
  80. path: 'article',
  81. name: 'subjectArticle',
  82. component: () => import('@/views/article/subject/article'),
  83. meta: { title: '专题文章', icon: 'form', noCache: true }
  84. },
  85. ]
  86. },
  87. ]
  88. },
  89. {
  90. path: '/ad',
  91. component: Layout,
  92. name: 'AD',
  93. meta: { title: '广告中心', icon: 'form' },
  94. children: [{
  95. path: 'index',
  96. name: 'adIndex',
  97. component: () => import('@/views/ad/index'),
  98. meta: { title: '首页管理', icon: 'form', noCache: true }
  99. }
  100. ]
  101. },
  102. {
  103. path: '/admin',
  104. component: Layout,
  105. name: 'Admin',
  106. meta: { title: '用户', icon: 'form' },
  107. children: [{
  108. path: 'index',
  109. name: 'AdminIndex',
  110. component: () => import('@/views/admin/index'),
  111. meta: { title: '管理员管理', icon: 'form', noCache: true }
  112. }
  113. ]
  114. },
  115. {
  116. path: '/role',
  117. component: Layout,
  118. name: 'Role',
  119. meta: { title: '角色', icon: 'form' },
  120. children: [{
  121. path: 'index',
  122. name: 'RoleIndex',
  123. component: () => import('@/views/role/index'),
  124. meta: { title: '角色管理', icon: 'form', noCache: true }
  125. }
  126. ]
  127. },
  128. ...warning,
  129. // ...games,
  130. {
  131. path: '/updateVersion',
  132. component: Layout,
  133. children: [{
  134. path: 'index',
  135. name: 'UpdateVersion',
  136. component: () => import('@/views/updateVersion/updateVersion'),
  137. meta: { title: '版本更新', icon: 'form', noCache: true }
  138. }]
  139. },
  140. ...playground,
  141. ]
  142. export default routes