Draft of Rules view (not working) with computer play
[vchess.git] / client / src / router.js
CommitLineData
625022fd
BA
1import Vue from "vue";
2import Router from "vue-router";
cf2343ce 3import Hall from "./views/Hall.vue";
625022fd
BA
4
5Vue.use(Router);
6
7function loadView(view) {
8 return () => import(/* webpackChunkName: "view-[request]" */ `@/views/${view}.vue`)
9}
10
11export default new Router({
12 routes: [
13 {
14 path: "/",
cf2343ce
BA
15 name: "hall",
16 component: Hall,
625022fd 17 },
5b020e73
BA
18 {
19 path: "/variants",
20 name: "variants",
21 component: loadView("Variants"),
22 },
cf2343ce
BA
23 {
24 path: "/variants/:vname([a-zA-Z0-9]+)",
25 name: "rules",
26 component: loadView("Rules"),
27 },
ccd4a2b7
BA
28// {
29// path: "/about",
30// name: "about",
31// // route level code-splitting
32// // this generates a separate chunk (about.[hash].js) for this route
33// // which is lazy-loaded when the route is visited.
34// component: loadView('About'),
35// //function() {
36// // return import(/* webpackChunkName: "about" */ "./views/About.vue");
37// //}
38// },
8d61fc4a 39 // TODO: gameRef, problemId: https://router.vuejs.org/guide/essentials/dynamic-matching.html
625022fd
BA
40 ]
41});