index.js 426 B

123456789101112131415161718192021222324
  1. import Vue from 'vue'
  2. import VueRouter from 'vue-router'
  3. import Home from '../pages/Home.vue'
  4. const originalPush = VueRouter.prototype.push
  5. VueRouter.prototype.push = function push (location) {
  6. return originalPush.call(this, location).catch(err => err)
  7. }
  8. Vue.use(VueRouter)
  9. const routes = [
  10. {
  11. path: '/',
  12. name: 'Home',
  13. component: Home
  14. }
  15. ]
  16. const router = new VueRouter({
  17. routes
  18. })
  19. export default router