This commit is contained in:
Pan
2017-06-28 23:02:22 +08:00
parent 2bc84413e3
commit c51c7fec5f
13 changed files with 319 additions and 351 deletions

View File

@@ -1,8 +1,7 @@
import Vue from 'vue';
import Router from 'vue-router';
const _import = require('./_import_' + process.env.NODE_ENV);
// in development env not use Lazy Loading,because Lazy Loading large page will cause webpack hot update too slow
// so only in production use Lazy Loading
// in development env not use Lazy Loading,because Lazy Loading large page will cause webpack hot update too slow.so only in production use Lazy Loading
/* layout */
import Layout from '../views/layout/Layout';
@@ -16,6 +15,7 @@ const dashboard = _import('dashboard/index');
/* error page */
const Err404 = _import('404');
/* demo page */
const Form = _import('page/form');
const Table = _import('table/index');
@@ -23,10 +23,10 @@ Vue.use(Router);
/**
* icon : the icon show in the sidebar
* hidden : if hidden:true will not show in the sidebar
* redirect : if redirect:noredirect will not redirct in the levelbar
* noDropdown : if noDropdown:true will not has submenu
* meta : { role: ['admin'] } will control the page role
* hidden : if `hidden:true` will not show in the sidebar
* redirect : if `redirect:noredirect` will not redirct in the levelbar
* noDropdown : if `noDropdown:true` will not has submenu in the sidebar
* meta : `{ role: ['admin'] }` will control the page role
**/
export const constantRouterMap = [
{ path: '/login', component: Login, hidden: true },
@@ -35,7 +35,7 @@ export const constantRouterMap = [
path: '/',
component: Layout,
redirect: '/dashboard',
name: '首页',
name: 'Home',
hidden: true,
children: [{ path: 'dashboard', component: dashboard }]
}
@@ -58,6 +58,7 @@ export const asyncRouterMap = [
{ path: 'index', component: Form, name: 'Form', icon: 'zonghe' }
]
},
{
path: '/table',
component: Layout,
@@ -67,5 +68,6 @@ export const asyncRouterMap = [
noDropdown: true,
children: [{ path: 'index', component: Table, name: 'Table', meta: { role: ['admin'] } }]
},
{ path: '*', redirect: '/404', hidden: true }
];