12345678910111213141516171819202122232425 |
- import {
- createRouter,
- createWebHashHistory,
- createWebHistory,
- Router
- } from 'vue-router'
- import routes from './routes-admin'
- const router: Router = createRouter({
- // history: createWebHistory('/website'),
- history: createWebHashHistory(),
- routes,
- scrollBehavior() {
- return new Promise((resolve, reject) => {
- resolve({ left: 0, top: 0 })
- })
- }
- })
- router.beforeEach((to, from, next) => {
- const title = to.meta.title
- document.title = (title || '酷乐秀') as any
- next()
- })
- export default router
|