mirror of
https://github.com/KevinMidboe/seasoned.git
synced 2026-03-11 03:49:07 +00:00
Add discover and section page routes with interfaces
This commit is contained in:
@@ -3,4 +3,5 @@ import type { IList } from "./IList";
|
||||
export default interface ISection {
|
||||
title: string;
|
||||
apiFunction: (page: number) => Promise<IList>;
|
||||
sectionType?: "list" | "discover";
|
||||
}
|
||||
|
||||
@@ -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"];
|
||||
|
||||
Reference in New Issue
Block a user