index.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. import Vue from 'vue'
  2. import Router from 'vue-router'
  3. import ElementUI from 'element-ui'
  4. import 'element-ui/lib/theme-chalk/index.css'
  5. import police from '@/components/police'
  6. import blockly from '@/components/blockly'
  7. import function1 from '@/components/function'
  8. import camera from '@/components/camera'
  9. import test from '@/components/test'
  10. import shop from '@/components/shop'
  11. import light from '@/components/light'
  12. import demo from '@/components/tuoDemo'
  13. import traffic from '@/components/traffic'
  14. import door from '@/components/door'
  15. import index from '@/components/index'
  16. import robot from '@/components/robot'
  17. import car from '@/components/car'
  18. Vue.use(Router).use(ElementUI)
  19. export default new Router({
  20. mode: 'history', //去掉url中的#
  21. routes: [
  22. {
  23. path: '/police',
  24. name: 'police',
  25. component: police
  26. },
  27. {
  28. path: '/blockly',
  29. name: 'blockly',
  30. component: blockly
  31. },
  32. {
  33. path: '/function',
  34. name: 'function',
  35. component: function1
  36. },
  37. {
  38. path: '/camera',
  39. name: 'camera',
  40. component: camera
  41. },
  42. {
  43. path: '/test',
  44. name: 'test',
  45. component: test
  46. },
  47. {
  48. path: '/light',
  49. name: 'light',
  50. component: light
  51. },
  52. {
  53. path: '/shop',
  54. name: 'shop',
  55. component: shop
  56. },
  57. {
  58. path: '/demo',
  59. name: 'demo',
  60. component: demo
  61. },
  62. {
  63. path: '/door',
  64. name: 'door',
  65. component: door
  66. },
  67. {
  68. path: '/',
  69. name: 'index',
  70. component: index
  71. },
  72. {
  73. path: '/traffic',
  74. name: 'traffic',
  75. component: traffic
  76. },
  77. {
  78. path: '/robot',
  79. name: 'robot',
  80. component: robot
  81. },
  82. {
  83. path: '/car',
  84. name: 'car',
  85. component: car
  86. }
  87. ]
  88. })