From df9db461e5823e068ac3c73514f8cae6b6d0b441 Mon Sep 17 00:00:00 2001 From: Kevin Midboe Date: Tue, 10 Mar 2026 23:50:25 +0100 Subject: [PATCH] Add discover and section page routes with interfaces --- src/interfaces/ISection.ts | 1 + src/routes.ts | 20 ++++++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/interfaces/ISection.ts b/src/interfaces/ISection.ts index 6196636..b2b197f 100644 --- a/src/interfaces/ISection.ts +++ b/src/interfaces/ISection.ts @@ -3,4 +3,5 @@ import type { IList } from "./IList"; export default interface ISection { title: string; apiFunction: (page: number) => Promise; + sectionType?: "list" | "discover"; } diff --git a/src/routes.ts b/src/routes.ts index 3bc48af..b636375 100644 --- a/src/routes.ts +++ b/src/routes.ts @@ -39,7 +39,17 @@ const routes: RouteRecordRaw[] = [ { name: "list", path: "/list/:name", - component: () => import("./pages/ListPage.vue") + component: () => import("./pages/SectionPage.vue") + }, + { + name: "discover-section", + path: "/discover/:name", + component: () => import("./pages/SectionPage.vue") + }, + { + name: "discover", + path: "/discover", + component: () => import("./pages/DiscoverPage.vue") }, { name: "search", @@ -104,7 +114,13 @@ const router = createRouter({ history: createWebHistory("/"), // base: "/", routes, - linkActiveClass: "is-active" + linkActiveClass: "is-active", + scrollBehavior(to, from, savedPosition) { + if (to.name !== "discover") return; + + console.log("scrolling top"); + return { top: 0 }; + } }); const loggedIn = () => store.getters["user/loggedIn"];