Commit | Line | Data |
---|---|---|
625022fd BA |
1 | import Vue from "vue"; |
2 | import Router from "vue-router"; | |
cf2343ce | 3 | import Hall from "./views/Hall.vue"; |
625022fd BA |
4 | |
5 | Vue.use(Router); | |
6 | ||
7 | function loadView(view) { | |
dac39588 | 8 | return () => import(/* webpackChunkName: "view-[request]" */ `@/views/${view}.vue`) |
625022fd BA |
9 | } |
10 | ||
1aeed627 BA |
11 | import { ajax } from "@/utils/ajax"; |
12 | import { store } from "@/store"; | |
13 | ||
786e0065 | 14 | const router = new Router({ |
625022fd BA |
15 | routes: [ |
16 | { | |
17 | path: "/", | |
cf2343ce BA |
18 | name: "hall", |
19 | component: Hall, | |
625022fd | 20 | }, |
5b020e73 BA |
21 | { |
22 | path: "/variants", | |
23 | name: "variants", | |
24 | component: loadView("Variants"), | |
25 | }, | |
cf2343ce BA |
26 | { |
27 | path: "/variants/:vname([a-zA-Z0-9]+)", | |
28 | name: "rules", | |
29 | component: loadView("Rules"), | |
30 | }, | |
1aeed627 BA |
31 | { |
32 | path: "/authenticate/:token", | |
33 | name: "authenticate", | |
a3ac374b BA |
34 | component: loadView("Auth"), |
35 | }, | |
36 | { | |
37 | path: "/logout", | |
38 | name: "logout", | |
39 | component: loadView("Logout"), | |
1aeed627 | 40 | }, |
89021f18 BA |
41 | { |
42 | path: "/problems", | |
43 | name: "myproblems", | |
44 | component: loadView("Problems"), | |
45 | }, | |
afd3240d BA |
46 | { |
47 | path: "/mygames", | |
48 | name: "mygames", | |
49 | component: loadView("MyGames"), | |
50 | }, | |
f7121527 | 51 | { |
71468011 | 52 | path: "/game/:id([a-zA-Z0-9]+)", |
f7121527 BA |
53 | name: "game", |
54 | component: loadView("Game"), | |
55 | }, | |
afd3240d | 56 | { |
677fe285 BA |
57 | path: "/analyse/:vname([a-zA-Z0-9]+)", |
58 | name: "analyse", | |
59 | component: loadView("Analyse"), | |
afd3240d | 60 | }, |
92a523d1 BA |
61 | { |
62 | path: "/about", | |
63 | name: "about", | |
64 | component: loadView("About"), | |
65 | }, | |
604b951e BA |
66 | { |
67 | path: "/news", | |
68 | name: "news", | |
69 | component: loadView("News"), | |
70 | }, | |
625022fd BA |
71 | ] |
72 | }); | |
786e0065 | 73 | |
786e0065 | 74 | export default router; |