summaryrefslogtreecommitdiff
path: root/src/App.vue
diff options
context:
space:
mode:
authorSukanya Pandey <sukapan1@in.ibm.com>2020-12-09 13:44:19 +0300
committerDerick Montague <derick.montague@ibm.com>2020-12-16 02:16:56 +0300
commitc5c2ae99f6e9b91526ea5896b3029ab8a7480c6f (patch)
tree5992782ede6c5f457f15a7037c5f71902588845a /src/App.vue
parentf6df801b384118b946bb3b7b3248832ec70cfd0a (diff)
downloadwebui-vue-c5c2ae99f6e9b91526ea5896b3029ab8a7480c6f.tar.xz
Show asset name in the app header
Signed-off-by: Sukanya Pandey <sukapan1@in.ibm.com> Change-Id: If5394604d6c91b3604eaadb33178376fe6da672c
Diffstat (limited to 'src/App.vue')
-rw-r--r--src/App.vue13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/App.vue b/src/App.vue
index f6991c46..fc04b70b 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -7,9 +7,22 @@
<script>
export default {
name: 'App',
+ computed: {
+ assetTag() {
+ return this.$store.getters['global/assetTag'];
+ },
+ },
watch: {
+ assetTag: function (tag) {
+ if (tag) {
+ document.title = `${tag} - ${this.$route.meta.title}`;
+ }
+ },
$route: function (to) {
document.title = to.meta.title || 'Page is missing title';
+ if (this.assetTag) {
+ document.title = `${this.assetTag} - ${to.meta.title}`;
+ }
},
},
created() {