gaoshuaixing 5 years ago
parent
commit
86ae2a15b1
2 changed files with 18 additions and 20 deletions
  1. 16 18
      frontend/src/config/router.config.js
  2. 2 2
      frontend/src/views/Layout.vue

+ 16 - 18
frontend/src/config/router.config.js

@@ -3,24 +3,22 @@
  * @type { *[] }
  * @type { *[] }
  */
  */
 export const constantRouterMap = [
 export const constantRouterMap = [
-    // {
-    //   path: '/test',
-    //   redirect: '/testa',
-    //   hidden: true,
-    //   children: [
-    //     {
-    //       path: '/testa',
-    //       name: 'testa',
-    //       component: { template: '<div>foo</div>' }
-    //     },
-    //     {
-    //       path: '/testb',
-    //       name: 'testb',
-    //       component: () => import(/* webpackChunkName: "user" */ '../views/Contentb')
-    //     }
-    //   ]
-    // },
+    {
+      path: '/testc',
+      component: { template: '<div><router-view /></div>' },
+      children: [
+        {
+          path: 'testc',
+          name: 'testc',
+          component: { template: '<div>ccc</div>' }
+        },
+        {
+          path: '/testd',
+          name: 'testd',
+          component: { template: '<div>ddd</div>' }
+        }
+      ]
+    },
     { path: '/testa', component: () => import('@/views/Contenta') },
     { path: '/testa', component: () => import('@/views/Contenta') },
     { path: '/testb', component: () => import('@/views/Contentb') }
     { path: '/testb', component: () => import('@/views/Contentb') }
-
   ]
   ]

+ 2 - 2
frontend/src/views/Layout.vue

@@ -64,11 +64,11 @@ export default {
         'menu_2' : {
         'menu_2' : {
           'subMenu_1' : {
           'subMenu_1' : {
             title: 'setting菜单1',
             title: 'setting菜单1',
-            page: ''
+            page: '/testc/testc'
           },
           },
           'subMenu_2' : {
           'subMenu_2' : {
             title: 'setting菜单2',
             title: 'setting菜单2',
-            page: ''
+            page: '/testd'
           },
           },
         },
         },
       },
       },