refactor:format code

This commit is contained in:
Pan
2017-11-17 14:57:39 +08:00
parent 6d6a9df5b8
commit 339d760771
17 changed files with 77 additions and 58 deletions

View File

@@ -1,30 +1,30 @@
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 too many pages will cause webpack hot update too slow.so only in production use Lazy Loading
// 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;
// detail: https://panjiachen.github.io/vue-element-admin-site/#/lazy-loading
Vue.use(Router)
/* layout */
/* Layout */
import Layout from '../views/layout/Layout'
/**
* hidden: true if `hidden:true` will not show in the sidebar(default is false)
* redirect: noredirect if `redirect:noredirect` will no redirct in the levelbar
* hidden: true if `hidden:true` will not show in the sidebar(default is false)
* redirect: noredirect if `redirect:noredirect` will no redirct in the breadcrumb
* name:'router-name' the name is used by <keep-alive> (must set!!!)
* meta : {
role: ['admin'] will control the page role
title: 'title' the name show in submenu and levelbar
icon: 'svg-name' the icon show in the sidebar,
noCache: true if fasle ,the page will no be cached(default is false)
role: ['admin','editor'] will control the page role (you can set multiple roles)
title: 'title' the name show in submenu and breadcrumb (recommend set)
icon: 'svg-name' the icon show in the sidebar,
noCache: true if fasle ,the page will no be cached(default is false)
}
**/
export const constantRouterMap = [
{ path: '/login', component: _import('login/index'), hidden: true },
{ path: '/authredirect', component: _import('login/authredirect'), hidden: true },
{ path: '/404', component: _import('errorPage/404'), hidden: true },
{ path: '/401', component: _import('errorPage/401'), hidden: true },
{
path: '',
component: Layout,
@@ -36,16 +36,15 @@ export const constantRouterMap = [
meta: { title: 'dashboard', icon: 'dashboard' }
}]
},
{
path: '/introduction',
path: '/documentation',
component: Layout,
redirect: '/introduction/index',
redirect: '/documentation/index',
children: [{
path: 'index',
component: _import('introduction/index'),
name: 'introduction',
meta: { title: 'introduction', icon: 'people' }
component: _import('documentation/index'),
name: 'documentation',
meta: { title: 'documentation', icon: 'documentation', noCache: true }
}]
}
]
@@ -81,7 +80,7 @@ export const asyncRouterMap = [
path: 'index',
component: _import('svg-icons/index'),
name: 'icons',
meta: { title: 'icons', icon: 'icon' }
meta: { title: 'icons', icon: 'icon', noCache: true }
}]
},