refactor
This commit is contained in:
@@ -1 +1 @@
|
||||
module.exports = file => require('@/views/' + file + '.vue')
|
||||
module.exports = file => require('@/views/' + file + '.vue').default
|
||||
|
@@ -1,25 +1,25 @@
|
||||
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
|
||||
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
|
||||
|
||||
/* layout */
|
||||
import Layout from '../views/layout/Layout';
|
||||
import Layout from '../views/layout/Layout'
|
||||
|
||||
/* login */
|
||||
const Login = _import('login/index');
|
||||
const Login = _import('login/index')
|
||||
|
||||
/* dashboard */
|
||||
const dashboard = _import('dashboard/index');
|
||||
const dashboard = _import('dashboard/index')
|
||||
|
||||
/* error page */
|
||||
const Err404 = _import('404');
|
||||
const Err404 = _import('404')
|
||||
|
||||
/* demo page */
|
||||
const Form = _import('page/form');
|
||||
const Table = _import('table/index');
|
||||
const Form = _import('page/form')
|
||||
const Table = _import('table/index')
|
||||
|
||||
Vue.use(Router);
|
||||
Vue.use(Router)
|
||||
|
||||
/**
|
||||
* icon : the icon show in the sidebar
|
||||
@@ -45,7 +45,7 @@ export default new Router({
|
||||
// mode: 'history', //后端支持可开
|
||||
scrollBehavior: () => ({ y: 0 }),
|
||||
routes: constantRouterMap
|
||||
});
|
||||
})
|
||||
|
||||
export const asyncRouterMap = [
|
||||
{
|
||||
@@ -63,10 +63,10 @@ export const asyncRouterMap = [
|
||||
path: '/table',
|
||||
component: Layout,
|
||||
redirect: '/table/index',
|
||||
icon: 'tubiaoleixingzhengchang',
|
||||
icon: 'tubiao',
|
||||
noDropdown: true,
|
||||
children: [{ path: 'index', component: Table, name: 'Table', meta: { role: ['admin'] } }]
|
||||
children: [{ path: 'index', component: Table, name: 'Table', meta: { role: ['admin'] }}]
|
||||
},
|
||||
|
||||
{ path: '*', redirect: '/404', hidden: true }
|
||||
];
|
||||
]
|
||||
|
Reference in New Issue
Block a user