完成web端导航栏

This commit is contained in:
2023-02-10 15:42:20 +08:00
parent 6f564eaa60
commit 4eb9cdfae7
11 changed files with 287 additions and 26 deletions
+44 -1
View File
@@ -1,7 +1,50 @@
import { createRouter, createWebHistory } from 'vue-router'
// 导入所有 view 页面
import PkIndexView from '../views/pk/PkIndexView.vue'
import RanklistIndexView from '../views/ranklist/RanklistIndexView.vue'
import RecordIndexView from '../views/record/RecordIndexView.vue'
import UserBotIndexView from '../views/user/bot/UserBotIndexView.vue'
import NotFound from '../views/error/NotFound.vue'
// 定义所有页面的 URL 路由
const routes = [
{
path:'/',
name:'home',
// 重定向:将 home 重定向到 pk 页面
redirect:'/pk/'
},
{
path:'/pk/',
name:'pk_index',
component:PkIndexView
},
{
path:'/ranklist/',
name:'ranklist_index',
component:RanklistIndexView
},
{
path:'/record/',
name:'record_index',
component:RecordIndexView
},
{
path:'/user/bot/',
name:'user_bot_index',
component:UserBotIndexView
},
{
path:'/404/',
name:'404',
component:NotFound
},
{
// 正则匹配所有其他非法页面到 404
path:'/:catchAll(.*)',
redirect:'/404/'
}
]
const router = createRouter({
@@ -9,4 +52,4 @@ const router = createRouter({
routes
})
export default router
export default router