mirror of
https://github.com/Chanzhaoyu/chatgpt-web.git
synced 2025-07-30 02:13:05 +00:00
32 lines
699 B
TypeScript
32 lines
699 B
TypeScript
import type { App } from 'vue'
|
|
import type { RouteRecordRaw } from 'vue-router'
|
|
import { createRouter, createWebHashHistory } from 'vue-router'
|
|
import { ChatLayout } from '@/views/chat/layout'
|
|
|
|
const routes: RouteRecordRaw[] = [
|
|
{
|
|
path: '/',
|
|
name: 'Root',
|
|
component: ChatLayout,
|
|
redirect: '/chat',
|
|
children: [
|
|
{
|
|
path: '/chat/:uuid?',
|
|
name: 'Chat',
|
|
component: () => import('@/views/chat/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()
|
|
}
|