layout update

This commit is contained in:
2025-05-10 00:04:53 +08:00
parent 52a2fd6625
commit b4c7238c8a
10 changed files with 73 additions and 49 deletions

View File

@@ -1,18 +1,40 @@
import { RouteRecordRaw } from "vue-router"
import { loadChart } from "./shared/composables/chart"
export const problem: RouteRecordRaw = {
path: "/problem/:problemID",
component: () => import("~/shared/layout/full.vue"),
children: [
{
path: "",
component: () => import("oj/problem/detail.vue"),
props: true,
name: "problem",
beforeEnter: loadChart,
},
],
}
export const contestProblem: RouteRecordRaw = {
path: "/contest/:contestID/problem/:problemID",
component: () => import("~/shared/layout/full.vue"),
children: [
{
path: "",
component: () => import("oj/problem/detail.vue"),
props: true,
name: "contest problem",
meta: { requiresAuth: true },
beforeEnter: loadChart,
},
],
}
export const ojs: RouteRecordRaw = {
path: "/",
component: () => import("~/shared/layout/default.vue"),
children: [
{ path: "", component: () => import("oj/problem/list.vue") },
{
path: "problem/:problemID",
component: () => import("oj/problem/detail.vue"),
props: true,
name: "problem",
beforeEnter: loadChart,
},
{
path: "submission",
component: () => import("oj/submission/list.vue"),
@@ -57,14 +79,6 @@ export const ojs: RouteRecordRaw = {
},
],
},
{
path: "contest/:contestID/problem/:problemID",
component: () => import("oj/problem/detail.vue"),
props: true,
name: "contest problem",
meta: { requiresAuth: true },
beforeEnter: loadChart,
},
{
path: "rank",
component: () => import("oj/rank/list.vue"),
@@ -89,8 +103,15 @@ export const ojs: RouteRecordRaw = {
component: () => import("oj/user/message.vue"),
meta: { requiresAuth: true },
},
],
}
export const learns: RouteRecordRaw = {
path: "/learn/:step+",
component: () => import("~/shared/layout/full.vue"),
children: [
{
path: "learn/:step+",
path: "",
component: () => import("learn/index.vue"),
name: "learn",
},