-
Notifications
You must be signed in to change notification settings - Fork 6
/
router.ts
41 lines (38 loc) · 1.07 KB
/
router.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import {ApiConsts} from "@/utils/consts";
import BasePage from "@/components/pages/BasePage.vue";
import HomePage from "@/components/pages/HomePage.vue";
import NotFoundPage from "@/components/pages/NotFoundPage.vue";
import RepoBranchesPage from "@/components/pages/RepoBranchesPage.vue";
import RepoCommitPage from "@/components/pages/RepoCommitPage.vue"; // eslint-disable-line import/max-dependencies
import Vue from "vue";
import VueRouter from "vue-router";
Vue.use(VueRouter);
export const router: VueRouter = new VueRouter({
// https://router.vuejs.org/guide/essentials/history-mode.html#html5-history-mode
mode: ApiConsts.ROUTER_HISTORY_MODE,
routes: [
{
children: [
{
component: HomePage,
path: "/",
},
{
component: RepoBranchesPage,
path: "/branches",
},
{
component: RepoCommitPage,
path: "/commit/:id",
props: true,
},
],
component: BasePage,
path: "",
},
{
component: NotFoundPage,
path: "*",
},
],
});