Açıklama Yok

index.js 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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. noCache: true
  36. // role: ['dd']
  37. }
  38. }
  39. ]
  40. },
  41. {
  42. path: '/gambleMember',
  43. component: Layout,
  44. redirect: '/gambleMember/index',
  45. children: [
  46. {
  47. path: 'index',
  48. name: 'GambleMember',
  49. component: _import('gambleMember/index'),
  50. meta: {
  51. title: '會員管理',
  52. icon: 'form'
  53. // role: ['dd']
  54. }
  55. }
  56. ]
  57. },
  58. {
  59. path: '/gambleGameBucket',
  60. component: Layout,
  61. redirect: '/gambleGameBucket/index',
  62. children: [
  63. {
  64. path: 'index',
  65. name: 'GambleGameBucket',
  66. component: _import('gambleGameBucket/index'),
  67. meta: {
  68. title: '每局紀錄',
  69. icon: 'form'
  70. // role: ['dd']
  71. },
  72. children: [
  73. {
  74. path: '/gambleGameBucket/index/detail',
  75. name: 'GambleGameBucketDetail',
  76. component: _import('gambleGameBucket/detail/index'),
  77. hidden: true,
  78. meta: {
  79. title: '詳細紀錄'
  80. // role: ['dd']
  81. }
  82. }
  83. ]
  84. }
  85. ]
  86. },
  87. // {
  88. // path: '/example',
  89. // component: Layout,
  90. // redirect: '/example/table',
  91. // name: 'Example',
  92. // meta: { title: 'Example', icon: 'example' },
  93. // children: [
  94. // {
  95. // path: 'table',
  96. // name: 'Table',
  97. // component: _import('table/index'),
  98. // meta: { title: 'Table', icon: 'table' }
  99. // },
  100. // {
  101. // path: 'tree',
  102. // name: 'Tree',
  103. // component: _import('tree/index'),
  104. // meta: { title: 'Tree', icon: 'tree' }
  105. // }
  106. // ]
  107. // },
  108. // {
  109. // path: '/form',
  110. // component: Layout,
  111. // children: [
  112. // {
  113. // path: 'index',
  114. // name: 'Form',
  115. // component: _import('form/index'),
  116. // meta: { title: 'Form', icon: 'form' }
  117. // }
  118. // ]
  119. // },
  120. { path: '*', redirect: '/404', hidden: true }
  121. ]
  122. export default new Router({
  123. // mode: 'history', //后端支持可开
  124. scrollBehavior: () => ({ y: 0 }),
  125. routes: constantRouterMap
  126. })