feat: 添加路由标题元数据,固定页头为 sticky

- 为所有子页面路由添加 meta.title 供页头动态展示
- 页头改为 position: sticky,滚动时固定在顶部
This commit is contained in:
2026-05-23 22:54:55 +08:00
parent 749d9752fd
commit ad847973bc
2 changed files with 10 additions and 4 deletions
+4
View File
@@ -42,6 +42,10 @@ const route = useRoute();
.shell-header { .shell-header {
height: auto; height: auto;
padding: 18px 20px 0; padding: 18px 20px 0;
position: sticky;
top: 0;
z-index: 10;
background: var(--surface);
} }
.shell-main { .shell-main {
+6 -4
View File
@@ -20,23 +20,23 @@ const routes: RouteRecordRaw[] = [
path: "/study", path: "/study",
name: "study", name: "study",
component: () => import("@/components/Study.vue"), component: () => import("@/components/Study.vue"),
meta: { requiresAuth: true }, meta: { requiresAuth: true, title: "学习任务" },
}, },
{ {
path: "/review", path: "/review",
component: () => import("@/components/Review.vue"), component: () => import("@/components/Review.vue"),
meta: { requiresAuth: true }, meta: { requiresAuth: true, title: "复习总览" },
}, },
{ {
path: "/review/detail/:type/:id", path: "/review/detail/:type/:id",
component: () => import("@/components/ReviewDetail.vue"), component: () => import("@/components/ReviewDetail.vue"),
meta: { requiresAuth: true }, meta: { requiresAuth: true, title: "复习详情" },
}, },
{ {
path: "/start-task/:taskNum", path: "/start-task/:taskNum",
name: "start-task", name: "start-task",
component: StartTask, component: StartTask,
meta: { requiresAuth: true }, meta: { requiresAuth: true, title: "学习会话" },
}, },
{ {
path: "/add-task", path: "/add-task",
@@ -44,6 +44,7 @@ const routes: RouteRecordRaw[] = [
component: () => import("@/components/TaskForm.vue"), component: () => import("@/components/TaskForm.vue"),
meta: { meta: {
requiresAuth: true, requiresAuth: true,
title: "创建学习任务",
action: "add", action: "add",
buttonText: "添加", buttonText: "添加",
}, },
@@ -54,6 +55,7 @@ const routes: RouteRecordRaw[] = [
component: () => import("@/components/TaskForm.vue"), component: () => import("@/components/TaskForm.vue"),
meta: { meta: {
requiresAuth: true, requiresAuth: true,
title: "更新学习任务",
action: "update", action: "update",
buttonText: "更新", buttonText: "更新",
}, },