From ad847973bcdaf6a206c7eabe3f70e4c1cebc29e0 Mon Sep 17 00:00:00 2001 From: cat_shark <1716967236@qq.com> Date: Sat, 23 May 2026 22:54:55 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E5=85=83=E6=95=B0=E6=8D=AE=EF=BC=8C=E5=9B=BA?= =?UTF-8?q?=E5=AE=9A=E9=A1=B5=E5=A4=B4=E4=B8=BA=20sticky?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 为所有子页面路由添加 meta.title 供页头动态展示 - 页头改为 position: sticky,滚动时固定在顶部 --- src/App.vue | 4 ++++ src/router/index.ts | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/App.vue b/src/App.vue index 03ff741..4ee81e3 100644 --- a/src/App.vue +++ b/src/App.vue @@ -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 { diff --git a/src/router/index.ts b/src/router/index.ts index eeee88a..c8d27b5 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -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: "更新", },