index.js 448 B

123456789101112131415
  1. import { createWebHashHistory, createRouter } from "vue-router";
  2. import { bookRoutes } from "./bookRouter";
  3. import { sourceRoutes } from "./sourceRouter";
  4. const router = createRouter({
  5. // history: createWebHistory(process.env.BASE_URL),
  6. history: createWebHashHistory(),
  7. // @ts-ignore
  8. routes: bookRoutes.concat(sourceRoutes),
  9. });
  10. router.afterEach((to) => {
  11. if (to.name == "shelf") document.title = "书架";
  12. });
  13. export default router;