Files
gloabl_award_front/src/router/index.ts

42 lines
1.1 KiB
TypeScript
Raw Normal View History

2026-02-06 15:10:17 +08:00
import { createRouter, createWebHistory } from 'vue-router'
/**
* :
* 1. meta属性为{ cache: true }
* 2. App.vue中使用RouteCache组件name来进行匹配
* 3. name默认是文件名,name不一致,defineOptions({ name: 'componentName' })
*/
const router = createRouter({
history: createWebHistory('/'),
// history: createWebHistory(import.meta.env.VITE_APP_URL),
routes: [
// {
// path: '/',
// },
2026-02-06 15:10:17 +08:00
{
path: '/:lang?',
component: () => import('@/views/AwardPage/container.vue'),
children: [
2026-02-06 15:42:57 +08:00
{
path: '',
name: 'AwardIndex',
component: () => import('@/views/AwardPage/index.vue')
2026-02-06 15:42:57 +08:00
},
{
path: 'contestants',
name: 'Contestants',
component: () => import('@/views/AwardPage/contestants.vue')
2026-02-06 15:42:57 +08:00
}
]
2026-02-06 15:10:17 +08:00
},
{
path: '/:pathMatch(.*)',
name: '404',
component: () => import('../views/404.vue')
}
]
})
export default router