diff options
author | HampusM <hampus@hampusmat.com> | 2021-06-11 22:18:45 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2021-06-11 22:18:45 +0200 |
commit | 88dca239e50d51acb5e12174c6bd0df8c4bc3b7b (patch) | |
tree | 4233094a0f83eee3f98033957b7d0beac35b2441 /packages/client/src/App.vue | |
parent | b2e0d3154336946336edee4e32b57a467e255050 (diff) |
Implemented title and favicon stuff
Diffstat (limited to 'packages/client/src/App.vue')
-rw-r--r-- | packages/client/src/App.vue | 27 |
1 files changed, 27 insertions, 0 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"; |