index.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. Vue.use(Router).use(ElementUI)
  17. export default new Router({
  18. mode: 'history', //去掉url中的#
  19. routes: [
  20. {
  21. path: '/police',
  22. name: 'police',
  23. component: police
  24. },
  25. {
  26. path: '/blockly',
  27. name: 'blockly',
  28. component: blockly
  29. },
  30. {
  31. path: '/function',
  32. name: 'function',
  33. component: function1
  34. },
  35. {
  36. path: '/camera',
  37. name: 'camera',
  38. component: camera
  39. },
  40. {
  41. path: '/test',
  42. name: 'test',
  43. component: test
  44. },
  45. {
  46. path: '/light',
  47. name: 'light',
  48. component: light
  49. },
  50. {
  51. path: '/shop',
  52. name: 'shop',
  53. component: shop
  54. },
  55. {
  56. path: '/demo',
  57. name: 'demo',
  58. component: demo
  59. },
  60. {
  61. path: '/door',
  62. name: 'door',
  63. component: door
  64. },
  65. {
  66. path: '/',
  67. name: 'index',
  68. component: index
  69. },
  70. {
  71. path: '/traffic',
  72. name: 'traffic',
  73. component: traffic
  74. }
  75. ]
  76. })