基本完成了用户相关前端页面的编写,经过测试能够实现相关功能
This commit is contained in:
@@ -90,9 +90,22 @@ function generateRoutesFromPages(): RouteRecordRaw[] {
|
||||
// Generate routes from pages directory
|
||||
const routes: RouteRecordRaw[] = generateRoutesFromPages();
|
||||
|
||||
// 添加额外的路由配置,特别是带参数的路由
|
||||
const extraRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/user/profile/:id",
|
||||
name: "UserProfile",
|
||||
component: () => import("@/pages/user/ProfilePage.vue"),
|
||||
},
|
||||
// 可以在这里添加其他需要特殊配置的路由
|
||||
];
|
||||
|
||||
// 合并自动生成的路由和额外的路由
|
||||
const allRoutes = [...routes, ...extraRoutes];
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHashHistory(),
|
||||
routes,
|
||||
routes: allRoutes,
|
||||
});
|
||||
|
||||
export default router;
|
||||
|
||||
Reference in New Issue
Block a user