This commit is contained in:
2025-05-10 20:00:02 +08:00
parent b4c7238c8a
commit a686510211
4 changed files with 20 additions and 56 deletions

View File

@@ -1,40 +1,18 @@
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"),
@@ -64,6 +42,14 @@ export const ojs: RouteRecordRaw = {
meta: { requiresAuth: true },
name: "contest problems",
},
{
path: "problem/:problemID",
component: () => import("oj/problem/detail.vue"),
props: true,
name: "contest problem",
meta: { requiresAuth: true },
beforeEnter: loadChart,
},
{
path: "submission",
component: () => import("oj/submission/list.vue"),
@@ -108,7 +94,7 @@ export const ojs: RouteRecordRaw = {
export const learns: RouteRecordRaw = {
path: "/learn/:step+",
component: () => import("~/shared/layout/full.vue"),
component: () => import("~/shared/layout/default.vue"),
children: [
{
path: "",