index.js 478 B

123456789101112131415161718
  1. import Vue from 'vue'
  2. import Router from 'vue-router'
  3. import {constantRouterMap} from '@/config/router.config'
  4. Vue.use(Router)
  5. const originalPush = Router.prototype.push;
  6. Router.prototype.push = function push(location) {
  7. console.log(location,10001000)
  8. return originalPush.call(this, location).catch(err => err)
  9. }
  10. export default new Router({
  11. mode: 'history',
  12. base: process.env.BASE_URL,
  13. scrollBehavior: () => ({y: 0}),
  14. routes: constantRouterMap
  15. })