Files
workspace/code/link56/link56-frontend-new/src/router/index.ts
T
2025-12-11 22:26:28 +08:00

51 lines
1.1 KiB
TypeScript

import type { App } from 'vue'
import { createRouter, createWebHashHistory } from 'vue-router'
import Layout from '@/layout/index.vue'
const router = createRouter({
history: createWebHashHistory(),
strict: true,
routes: [
{
path: '/',
component: Layout,
children: [
{
path: '/',
component: () => import('@/views/home/index.vue'),
},
],
},
{
path: '/auth/login',
name: 'Login',
component: () => import('@/views/auth/login.vue'),
},
{
path: '/auth/register',
name: 'Register',
component: () => import('@/views/auth/register.vue'),
},
{
path: '/auth/forget',
name: 'Forget',
component: () => import('@/views/auth/forget.vue'),
},
{
path: '/error/500',
name: 'Error',
component: () => import('@/views/error/500.vue'),
},
{
path: '/:pathMatch(.*)*',
name: 'NotFound',
component: () => import('@/views/error/404.vue'),
},
],
scrollBehavior: () => ({ left: 0, top: 0 }),
})
export function setupRouter(app: App) {
app.use(router)
}