index.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. import Vue from 'vue'
  2. import VueRouter from 'vue-router'
  3. Vue.use(VueRouter)
  4. const originalPush = VueRouter.prototype.push
  5. VueRouter.prototype.push = function push (location) {
  6. return originalPush.call(this, location).catch(err => err)
  7. }
  8. const routes = [
  9. {
  10. path: '/',
  11. name: 'Index',
  12. component: () => import('../pages/index/index.vue')
  13. },
  14. {
  15. path: '/search',
  16. name: 'Search',
  17. component: () => import('../pages/search/index.vue'),
  18. meta: {id: ''}
  19. },
  20. {
  21. path: '/result',
  22. name: 'Result',
  23. component: () => import('../pages/result/index.vue'),
  24. meta: {id: ''}
  25. },
  26. {
  27. path: '/story',
  28. name: 'Story',
  29. component: () => import('../pages/story/index.vue'),
  30. meta: {id: 2}
  31. },
  32. {
  33. path: '/list',
  34. name: 'List',
  35. component: () => import('../pages/list/index.vue'),
  36. meta: {id: 2}
  37. },
  38. {
  39. path: '/floorlist/:id',
  40. name: 'Floorlist',
  41. component: () => import('../pages/floorlist/index.vue'),
  42. meta: {id: 3}
  43. },
  44. {
  45. path: '/parts',
  46. name: 'Parts',
  47. component: () => import('../pages/parts/index.vue'),
  48. meta: {id: 2}
  49. },
  50. {
  51. path: '/select',
  52. name: 'Select',
  53. component: () => import('../pages/select/index.vue'),
  54. meta: {id: 3}
  55. },
  56. {
  57. path: '/video',
  58. name: 'Video',
  59. component: () => import('../pages/video/index.vue'),
  60. meta: {id: 4}
  61. },
  62. {
  63. path: '/tunnel',
  64. name: 'Tunnel',
  65. component: () => import('../pages/tunnel/index.vue'),
  66. meta: {id: 1}
  67. }
  68. ]
  69. const router = new VueRouter({
  70. routes
  71. })
  72. export default router