diff options
Diffstat (limited to 'src/frontend/router/index.js')
-rw-r--r-- | src/frontend/router/index.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/frontend/router/index.js b/src/frontend/router/index.js index 68762cd..fc332cd 100644 --- a/src/frontend/router/index.js +++ b/src/frontend/router/index.js @@ -3,6 +3,7 @@ import Home from "../views/Home"; import Repository from "../views/Repository"; import RepositoryLog from "../views/RepositoryLog"; import RepositoryCommit from "../views/RepositoryCommit"; +import RepositoryTree from "../views/RepositoryTree"; const routes = [ { @@ -19,17 +20,23 @@ const routes = [ { name: "Repository Log", path: "log", - component: RepositoryLog, + component: RepositoryLog }, { name: "Commit", path: "log/:commit([a-fA-F0-9]{40}$)", component: RepositoryCommit, props: route => ({ commit: route.params.commit }) + }, + { + name: "Tree Entry", + path: "tree/:path*", + component: RepositoryTree, + props: route => ({ pathArr: route.params.path ? route.params.path : [] }) } ] } -] +]; const router = createRouter({ history: createWebHistory(process.env.BASE_URL), |