Brak opisu

index.js 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. import Vue from 'vue'
  2. import Router from 'vue-router'
  3. const _import = require('./_import_' + process.env.NODE_ENV)
  4. // in development-env not use lazy-loading, because lazy-loading too many pages will cause webpack hot update too slow. so only in production use lazy-loading;
  5. // detail: https://panjiachen.github.io/vue-element-admin-site/#/lazy-loading
  6. Vue.use(Router)
  7. /* Layout */
  8. import Layout from '../views/layout/Layout'
  9. /**
  10. * hidden: true if `hidden:true` will not show in the sidebar(default is false)
  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. export const constantRouterMap = [
  19. { path: '/login', component: _import('login/index'), hidden: true },
  20. { path: '/401', component: _import('errorPage/401'), hidden: true },
  21. { path: '/404', component: _import('errorPage/404'), hidden: true },
  22. {
  23. path: '',
  24. component: Layout,
  25. redirect: 'dashboard',
  26. name: 'Dashboard',
  27. children: [
  28. {
  29. path: 'dashboard',
  30. name: 'dashboard',
  31. component: _import('dashboard/index'),
  32. meta: {
  33. title: '首頁',
  34. icon: 'dashboard'
  35. // role: ['dd']
  36. }
  37. }
  38. ]
  39. },
  40. {
  41. path: '/gambleMember',
  42. component: Layout,
  43. redirect: '/gambleMember/index',
  44. children: [
  45. {
  46. path: 'index',
  47. name: 'GambleMember',
  48. component: _import('gambleMember/index'),
  49. meta: {
  50. title: '會員管理',
  51. icon: 'form'
  52. // role: ['dd']
  53. }
  54. }
  55. ]
  56. },
  57. {
  58. path: '/gambleGameBucket',
  59. component: Layout,
  60. redirect: '/gambleGameBucket/index',
  61. children: [
  62. {
  63. path: 'index',
  64. name: 'GambleGameBucket',
  65. component: _import('gambleGameBucket/index'),
  66. meta: {
  67. title: '每局紀錄',
  68. icon: 'form'
  69. // role: ['dd']
  70. }
  71. }
  72. ]
  73. },
  74. // {
  75. // path: '/example',
  76. // component: Layout,
  77. // redirect: '/example/table',
  78. // name: 'Example',
  79. // meta: { title: 'Example', icon: 'example' },
  80. // children: [
  81. // {
  82. // path: 'table',
  83. // name: 'Table',
  84. // component: _import('table/index'),
  85. // meta: { title: 'Table', icon: 'table' }
  86. // },
  87. // {
  88. // path: 'tree',
  89. // name: 'Tree',
  90. // component: _import('tree/index'),
  91. // meta: { title: 'Tree', icon: 'tree' }
  92. // }
  93. // ]
  94. // },
  95. // {
  96. // path: '/form',
  97. // component: Layout,
  98. // children: [
  99. // {
  100. // path: 'index',
  101. // name: 'Form',
  102. // component: _import('form/index'),
  103. // meta: { title: 'Form', icon: 'form' }
  104. // }
  105. // ]
  106. // },
  107. { path: '*', redirect: '/404', hidden: true }
  108. ]
  109. export default new Router({
  110. // mode: 'history', //后端支持可开
  111. scrollBehavior: () => ({ y: 0 }),
  112. routes: constantRouterMap
  113. })