diff --git a/src/router/index.js b/src/router/index.js index 559de4fd..ed9929e4 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -167,15 +167,6 @@ export const asyncRoutes = [ title: 'Role Permission', roles: ['admin'] } - }, - { - path: 'path', - component: () => import('@/views/permission/route'), - name: 'Route', - meta: { - title: 'Route', - roles: ['admin'] - } } ] }, @@ -404,6 +395,26 @@ const createRouter = () => new Router({ const router = createRouter() +if (process.env.NODE_ENV === 'development') { + router.addRoutes([ + { + path: '/', + component: Layout, + redirect: '/dashboard', + children: [ + { + path: 'route', + component: () => import('@/views/permission/route'), + name: 'Route', + meta: { + title: 'Route', + roles: ['admin'] + } + } + ] + }]) +} + // Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465 export function resetRouter() { const newRouter = createRouter()