feat: 调整为路由模式

This commit is contained in:
ChenZhaoYu
2023-02-13 12:38:44 +08:00
parent 39f718ef16
commit 951636869b
16 changed files with 316 additions and 23 deletions

22
src/router/index.ts Normal file
View File

@@ -0,0 +1,22 @@
import type { App } from 'vue'
import type { RouteRecordRaw } from 'vue-router'
import { createRouter, createWebHashHistory } from 'vue-router'
const routes: RouteRecordRaw[] = [
{
path: '/',
name: 'Home',
component: () => import('@/views/Home/index.vue'),
},
]
export const router = createRouter({
history: createWebHashHistory(),
routes,
scrollBehavior: () => ({ left: 0, top: 0 }),
})
export async function setupRouter(app: App) {
app.use(router)
await router.isReady()
}