frontend/src/router.ts

32 lines
722 B
TypeScript
Raw Normal View History

2019-07-06 22:04:33 +02:00
import Vue from "vue";
import Router from "vue-router";
import JoinRoom from "./views/JoinRoom.vue";
2019-07-07 17:28:00 +02:00
import Game from "./views/Game.vue";
2019-07-06 20:45:17 +02:00
Vue.use(Router);
export default new Router({
2019-07-06 22:04:33 +02:00
mode: "history",
2019-07-06 20:45:17 +02:00
base: process.env.BASE_URL,
routes: [
{
2019-07-06 22:04:33 +02:00
path: "/",
name: "home",
component: JoinRoom,
2019-07-06 20:45:17 +02:00
},
2019-07-07 17:28:00 +02:00
{
path: "/game/:code",
name: "game",
component: Game,
},
2019-07-06 20:45:17 +02:00
{
2019-07-06 22:04:33 +02:00
path: "/about",
name: "about",
2019-07-06 20:45:17 +02:00
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
2019-07-06 22:04:33 +02:00
component: () => import(/* webpackChunkName: "about" */ "./views/About.vue"),
2019-07-06 20:45:17 +02:00
},
],
});