diff options
Diffstat (limited to 'packages/client/src')
-rw-r--r-- | packages/client/src/App.vue | 27 | ||||
-rw-r--r-- | packages/client/src/router/index.js | 6 |
2 files changed, 30 insertions, 3 deletions
diff --git a/packages/client/src/App.vue b/packages/client/src/App.vue index e74b3f9..0c50f3a 100644 --- a/packages/client/src/App.vue +++ b/packages/client/src/App.vue @@ -2,6 +2,33 @@ <router-view /> </template> +<script> +export default { + name: "App", + data: function() { + return { + base_title: "" + }; + }, + methods: { + setTitle() { + const repo = this.$route.params.repo; + const route = this.$route.name; + document.title = repo ? `${repo} - ${route}` : this.base_title; + } + }, + created() { + this.base_title = document.title; + this.setTitle(); + }, + watch: { + $route() { + this.setTitle(); + } + } +}; +</script> + <style lang="scss"> @use "scss/colors"; @use "scss/variables"; diff --git a/packages/client/src/router/index.js b/packages/client/src/router/index.js index a6db1e1..ed53590 100644 --- a/packages/client/src/router/index.js +++ b/packages/client/src/router/index.js @@ -15,12 +15,12 @@ const routes = [ children: [ { path: "about", - name: "Repository About", + name: "About", component: () => import("../views/RepositoryAbout") }, { path: "log", - name: "Repository Log", + name: "Log", component: () => import("../views/RepositoryLog") }, { @@ -31,7 +31,7 @@ const routes = [ }, { path: "tree/:path*", - name: "Tree Entry", + name: "Tree", component: () => import("../views/RepositoryTree"), props: route => ({ pathArr: route.params.path ? route.params.path : [] }) }, |