feat: 添加路由标题元数据,固定页头为 sticky
- 为所有子页面路由添加 meta.title 供页头动态展示 - 页头改为 position: sticky,滚动时固定在顶部
This commit is contained in:
@@ -42,6 +42,10 @@ const route = useRoute();
|
||||
.shell-header {
|
||||
height: auto;
|
||||
padding: 18px 20px 0;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
background: var(--surface);
|
||||
}
|
||||
|
||||
.shell-main {
|
||||
|
||||
+6
-4
@@ -20,23 +20,23 @@ const routes: RouteRecordRaw[] = [
|
||||
path: "/study",
|
||||
name: "study",
|
||||
component: () => import("@/components/Study.vue"),
|
||||
meta: { requiresAuth: true },
|
||||
meta: { requiresAuth: true, title: "学习任务" },
|
||||
},
|
||||
{
|
||||
path: "/review",
|
||||
component: () => import("@/components/Review.vue"),
|
||||
meta: { requiresAuth: true },
|
||||
meta: { requiresAuth: true, title: "复习总览" },
|
||||
},
|
||||
{
|
||||
path: "/review/detail/:type/:id",
|
||||
component: () => import("@/components/ReviewDetail.vue"),
|
||||
meta: { requiresAuth: true },
|
||||
meta: { requiresAuth: true, title: "复习详情" },
|
||||
},
|
||||
{
|
||||
path: "/start-task/:taskNum",
|
||||
name: "start-task",
|
||||
component: StartTask,
|
||||
meta: { requiresAuth: true },
|
||||
meta: { requiresAuth: true, title: "学习会话" },
|
||||
},
|
||||
{
|
||||
path: "/add-task",
|
||||
@@ -44,6 +44,7 @@ const routes: RouteRecordRaw[] = [
|
||||
component: () => import("@/components/TaskForm.vue"),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
title: "创建学习任务",
|
||||
action: "add",
|
||||
buttonText: "添加",
|
||||
},
|
||||
@@ -54,6 +55,7 @@ const routes: RouteRecordRaw[] = [
|
||||
component: () => import("@/components/TaskForm.vue"),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
title: "更新学习任务",
|
||||
action: "update",
|
||||
buttonText: "更新",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user