import { createRouter, createWebHistory } from 'vue-router' import routes from './routes' const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), routes, scrollBehavior: () => ({ left: 0, top: 0, behavior: 'smooth' }) }) // 路由守卫 router.beforeEach(() => {}) router.afterEach((to) => { document.title = import.meta.env.VITE_APP_TITLE + ` | ${to.meta.title || ''}` }) export default router