From 88dca239e50d51acb5e12174c6bd0df8c4bc3b7b Mon Sep 17 00:00:00 2001
From: HampusM <hampus@hampusmat.com>
Date: Fri, 11 Jun 2021 22:18:45 +0200
Subject: Implemented title and favicon stuff

---
 packages/client/src/App.vue | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

(limited to 'packages/client/src/App.vue')

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";
-- 
cgit v1.2.3-18-g5258

