Sfoglia il codice sorgente

fix dashboard route

EthnaYeh 7 anni fa
parent
commit
47641f0793
3 ha cambiato i file con 32 aggiunte e 21 eliminazioni
  1. 1 1
      src/components/Breadcrumb/index.vue
  2. 1 0
      src/icons/svg/dashboard.svg
  3. 30 20
      src/router/index.js

+ 1 - 1
src/components/Breadcrumb/index.vue

@@ -29,7 +29,7 @@ export default {
29 29
       let matched = this.$route.matched.filter(item => item.name)
30 30
       const first = matched[0]
31 31
       if (first && first.name !== 'dashboard') {
32
-        matched = [{ path: '/dashboard', meta: { title: 'Dashboard' }}].concat(matched)
32
+        matched = [{ path: '/dashboard', meta: { title: '首頁' }}].concat(matched)
33 33
       }
34 34
       this.levelList = matched
35 35
     }

File diff suppressed because it is too large
+ 1 - 0
src/icons/svg/dashboard.svg


+ 30 - 20
src/router/index.js

@@ -23,17 +23,39 @@ export const constantRouterMap = [
23 23
   { path: '/404', component: _import('404'), hidden: true },
24 24
 
25 25
   {
26
-    path: '/',
26
+    path: '',
27 27
     component: Layout,
28
-    redirect: '/dashboard',
28
+    redirect: 'dashboard',
29 29
     name: 'Dashboard',
30
-    hidden: true,
31
-    children: [{
32
-      path: 'dashboard',
33
-      component: _import('dashboard/index')
34
-    }]
30
+    children: [
31
+      {
32
+        path: 'dashboard',
33
+        component: _import('dashboard/index'),
34
+        meta: {
35
+          title: '首頁',
36
+          icon: 'dashboard'
37
+          // role: ['dd']
38
+        }
39
+      }
40
+    ]
41
+  },
42
+  {
43
+    path: '/gambleMember',
44
+    component: Layout,
45
+    redirect: '/gambleMember/index',
46
+    children: [
47
+      {
48
+        path: 'index',
49
+        name: 'GambleMember',
50
+        component: _import('gambleMember/index'),
51
+        meta: {
52
+          title: '會員管理',
53
+          icon: 'form'
54
+          // role: ['dd']
55
+        }
56
+      }
57
+    ]
35 58
   },
36
-
37 59
   // {
38 60
   //   path: '/example',
39 61
   //   component: Layout,
@@ -69,18 +91,6 @@ export const constantRouterMap = [
69 91
   //   ]
70 92
   // },
71 93
 
72
-  {
73
-    path: '/gambleMember',
74
-    component: Layout,
75
-    children: [
76
-      {
77
-        path: 'index',
78
-        name: 'gambleMember',
79
-        component: _import('gambleMember/index'),
80
-        meta: { title: '會員管理', icon: 'form' }
81
-      }
82
-    ]
83
-  },
84 94
   { path: '*', redirect: '/404', hidden: true }
85 95
 ]
86 96