aboutsummaryrefslogtreecommitdiff
path: root/packages/client/src/router
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2021-07-06 13:07:07 +0200
committerHampusM <hampus@hampusmat.com>2021-07-06 13:07:07 +0200
commit39c38c737114dc7f946b1895b2a4ba27a5546c60 (patch)
tree61344a90155845d08c4811da16e6f90504da2625 /packages/client/src/router
parent4102adab527ccc4f6d8ac210118dea21177c212d (diff)
Migrated frontend to typescript
Diffstat (limited to 'packages/client/src/router')
-rw-r--r--packages/client/src/router/index.ts (renamed from packages/client/src/router/index.js)18
1 files changed, 9 insertions, 9 deletions
diff --git a/packages/client/src/router/index.js b/packages/client/src/router/index.ts
index b20a473..27ea978 100644
--- a/packages/client/src/router/index.js
+++ b/packages/client/src/router/index.ts
@@ -1,37 +1,37 @@
-import { createRouter, createWebHashHistory } from "vue-router";
+import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";
-const routes = [
+const routes: RouteRecordRaw[] = [
{
path: "/",
name: "Home",
- component: () => import("../views/Home")
+ component: () => import("../views/Home.vue")
},
{
path: "/:repo([a-zA-Z0-9\\.\\-_]+)",
name: "Repository",
- component: () => import("../views/Repository"),
+ component: () => import("../views/Repository.vue"),
props: route => ({ repository: route.params.repo }),
children: [
{
path: "about",
name: "About",
- component: () => import("../views/RepositoryAbout")
+ component: () => import("../views/RepositoryAbout.vue")
},
{
path: "log",
name: "Log",
- component: () => import("../views/RepositoryLog")
+ component: () => import("../views/RepositoryLog.vue")
},
{
path: "log/:commit([a-fA-F0-9]{40}$)",
name: "Commit",
- component: () => import("../views/RepositoryCommit"),
+ component: () => import("../views/RepositoryCommit.vue"),
props: route => ({ commit: route.params.commit })
},
{
path: "tree/:path*",
name: "Tree",
- component: () => import("../views/RepositoryTree"),
+ component: () => import("../views/RepositoryTree.vue"),
props: route => ({ pathArr: route.params.path ? route.params.path : [] })
}
/* {
@@ -42,7 +42,7 @@ const routes = [
},
{
path: "/:PageNotFound(.*)*",
- component: () => import("../views/PageNotFound")
+ component: () => import("../views/PageNotFound.vue")
}
];