guhongwei 4 年 前
コミット
ea3e3b287e
1 ファイル変更51 行追加54 行削除
  1. 51 54
      src/router/index.js

+ 51 - 54
src/router/index.js

@@ -4,66 +4,64 @@ import checkLogin from './before';
 
 Vue.use(VueRouter);
 
-const index = [
+const routes = [
   {
     path: '/',
     meta: { title: '首页' },
     component: () => import('../views/index.vue'),
-    children: [
-      {
-        path: '/anchor/index',
-        meta: { title: '主播管理' },
-        component: () => import('../views/anchor/index.vue'),
-      },
+  },
+  {
+    path: '/anchor/index',
+    meta: { title: '主播管理' },
+    component: () => import('../views/anchor/index.vue'),
+  },
 
-      {
-        path: '/anchor/detail',
-        meta: { title: '主播详情' },
-        component: () => import('../views/anchor/detail.vue'),
-      },
-      {
-        path: '/role/index',
-        meta: { title: '菜单管理' },
-        component: () => import('../views/role/index.vue'),
-      },
+  {
+    path: '/anchor/detail',
+    meta: { title: '主播详情' },
+    component: () => import('../views/anchor/detail.vue'),
+  },
+  {
+    path: '/role/index',
+    meta: { title: '菜单管理' },
+    component: () => import('../views/role/index.vue'),
+  },
 
-      {
-        path: '/role/detail',
-        meta: { title: '菜单详情' },
-        component: () => import('../views/role/detail.vue'),
-      },
-      {
-        path: '/live/index',
-        meta: { title: '直播管理' },
-        component: () => import('../views/live/index.vue'),
-      },
-      {
-        path: '/room/index',
-        meta: { title: '房间管理' },
-        component: () => import('../views/room/index.vue'),
-      },
+  {
+    path: '/role/detail',
+    meta: { title: '菜单详情' },
+    component: () => import('../views/role/detail.vue'),
+  },
+  {
+    path: '/live/index',
+    meta: { title: '直播管理' },
+    component: () => import('../views/live/index.vue'),
+  },
+  {
+    path: '/room/index',
+    meta: { title: '房间管理' },
+    component: () => import('../views/room/index.vue'),
+  },
 
-      {
-        path: '/room/detail',
-        meta: { title: '房间详情' },
-        component: () => import('../views/room/detail.vue'),
-      },
-      {
-        path: '/stat/index',
-        meta: { title: '统计管理' },
-        component: () => import('../views/stat/index.vue'),
-      },
-      {
-        path: '/test/index',
-        meta: { title: '测试管理' },
-        component: () => import('../views/test/index.vue'),
-      },
-      {
-        path: '/test/detail',
-        meta: { title: '添加' },
-        component: () => import('../views/test/detail.vue'),
-      },
-    ],
+  {
+    path: '/room/detail',
+    meta: { title: '房间详情' },
+    component: () => import('../views/room/detail.vue'),
+  },
+  {
+    path: '/stat/index',
+    meta: { title: '统计管理' },
+    component: () => import('../views/stat/index.vue'),
+  },
+  {
+    path: '/test/index',
+    meta: { title: '测试管理' },
+    component: () => import('../views/test/index.vue'),
+  },
+  {
+    path: '/test/detail',
+    meta: { title: '添加' },
+    component: () => import('../views/test/detail.vue'),
   },
   {
     path: '/login',
@@ -71,7 +69,6 @@ const index = [
     component: () => import('../views/login.vue'),
   },
 ];
-const routes = [...index];
 const router = new VueRouter({
   mode: 'history',
   base: process.env.NODE_ENV === 'development' ? '' : process.env.VUE_APP_ROUTER,