index.js 363 B

123456789101112131415
  1. import Vue from 'vue'
  2. import VueRouter from 'vue-router'
  3. import CommonRouters from '@/router/router'
  4. const routerPush = VueRouter.prototype.push
  5. VueRouter.prototype.push = function push(location) {
  6. return routerPush.call(this, location).catch(error=> error)
  7. }
  8. Vue.use(VueRouter)
  9. export default new VueRouter({
  10. // mode:'history',
  11. routes: CommonRouters
  12. })