数字化园区前端项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526
  1. import Vue from "vue";
  2. import VueRouter from "vue-router";
  3. import hhr from "./hhr";
  4. Vue.use(VueRouter);
  5. const routes = [...hhr];
  6. const router = new VueRouter({
  7. mode: "history",
  8. base: "web",
  9. routes,
  10. });
  11. router.beforeEach((to, from, next) => {
  12. /* 路由发生变化修改页面title */
  13. if (to.meta.title) {
  14. document.title = to.meta.title;
  15. }
  16. });
  17. const originalPush = VueRouter.prototype.push;
  18. VueRouter.prototype.push = function push(location) {
  19. return originalPush.call(this, location).catch(err => err);
  20. };
  21. export default router;