index.js 758 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import Vue from 'vue'
  2. import VueRouter from 'vue-router'
  3. import Home from '../views/Home.vue'
  4. import bigscene from '../views/bigscene'
  5. import map from '../views/map'
  6. import picture from '../views/picture'
  7. const originalPush = VueRouter.prototype.push
  8. VueRouter.prototype.push = function push (location) {
  9. return originalPush.call(this, location).catch(err => err)
  10. }
  11. Vue.use(VueRouter)
  12. const routes = [
  13. {
  14. path: '/',
  15. name: 'Home',
  16. component: Home
  17. },
  18. {
  19. path: '/bigscene/:id',
  20. name: 'bigscene',
  21. component: bigscene
  22. },
  23. {
  24. path: '/map',
  25. name: 'map',
  26. component: map
  27. },
  28. {
  29. path: '/picture',
  30. name: 'picture',
  31. component: picture
  32. }
  33. ]
  34. const router = new VueRouter({
  35. routes
  36. })
  37. export default router