Guest User

Untitled

a guest
Feb 22nd, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. import Vue from 'vue'
  2. import Router from 'vue-router'
  3.  
  4. const routerOptions = [
  5. { path: '/', component: 'Dashboard', name: 'Dashboard', icon: 'web' },
  6. { path: '/ToDo', component: 'ToDo', name: 'ToDo', icon: 'view_list' },
  7. { path: '/Portfolios', component: 'Portfolios', name: 'Portfolios', icon: 'pie_chart',
  8. children: [
  9. { path: ':key', component: 'Portfolio', name: 'Portfolio',
  10. children: [
  11. { path: '', component: 'Dashboard', name: 'Dashboard' },
  12. { path: 'projects', component: 'Projects', name: 'Projects' },
  13. { path: 'issues', component: 'Issues', name: 'Issues & Changes' },
  14. { path: 'risks', component: 'Risks', name: 'Risks' },
  15. { path: 'financials', component: 'Financials', name: 'Financials' }
  16. ]}
  17. ]},
  18. { path: '/Projects', component: 'Projects', name: 'Projects', icon: 'widgets',
  19. children: [
  20. { path: ':key', component: 'Project', name: 'Project',
  21. children: [
  22. { path: '', component: 'Dashboard', name: 'Dashboard' },
  23. { path: 'issues', component: 'Issues', name: 'Issues & Changes' },
  24. { path: 'risks', component: 'Risks', name: 'Risks' },
  25. { path: 'financials', component: 'Financials', name: 'Financials' }
  26. ]}
  27. ]},
  28.  
  29. ]
  30.  
  31. const routes = routerOptions.map(route => {
  32. return {
  33. path: route.path,
  34. component: () => import(`@/components/05_pages/${route.component}/${route.component}.vue`),
  35. name: route.name,
  36. icon: route.icon
  37. }
  38. })
  39.  
  40. Vue.use(Router)
  41.  
  42. export default new Router({
  43. mode: 'history',
  44. routes
  45. })
Add Comment
Please, Sign In to add comment